From 642fad5645a336322aa6e71a737e07f4ccf2962b Mon Sep 17 00:00:00 2001 From: Michael Nutt Date: Tue, 9 Jul 2024 10:05:07 +0900 Subject: [PATCH] QCryptographicHash takes a QByteArrayView now --- Source/WebCore/PAL/pal/crypto/qt/CryptoDigestQt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/WebCore/PAL/pal/crypto/qt/CryptoDigestQt.cpp b/Source/WebCore/PAL/pal/crypto/qt/CryptoDigestQt.cpp index 35ab9b13a75b2..f23965216f157 100644 --- a/Source/WebCore/PAL/pal/crypto/qt/CryptoDigestQt.cpp +++ b/Source/WebCore/PAL/pal/crypto/qt/CryptoDigestQt.cpp @@ -79,7 +79,7 @@ std::unique_ptr CryptoDigest::create(CryptoDigest::Algorithm algor void CryptoDigest::addBytes(std::span input) { - m_context->hash.addData(input); + m_context->hash.addData(QByteArrayView(input.data(), input.size())); } Vector CryptoDigest::computeHash() @@ -92,7 +92,7 @@ Vector CryptoDigest::computeHash() std::optional> CryptoDigest::computeHash(Algorithm algorithm, const Vector& input, UseCryptoKit) { QCryptographicHash hash(toQtAlgorithm(algorithm)); - hash.addData(input); + hash.addData(QByteArrayView(input.span().data(), input.span().size())); QByteArray digest = hash.result(); return Vector(std::span { reinterpret_cast(digest.constData()), static_cast(digest.size()) });