41# ifndef QT_SHA3_KECCAK_COMPAT
42 Sha3_224 = RealSha3_224,
43 Sha3_256 = RealSha3_256,
44 Sha3_384 = RealSha3_384,
45 Sha3_512 = RealSha3_512,
47 Sha3_224 = Keccak_224,
48 Sha3_256 = Keccak_256,
49 Sha3_384 = Keccak_384,
50 Sha3_512 = Keccak_512,
65 explicit QCryptographicHash(Algorithm method);
66 QCryptographicHash(QCryptographicHash &&other)
noexcept : d(std::exchange(other.d,
nullptr)) {}
67 ~QCryptographicHash();
69 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QCryptographicHash)
70 void swap(QCryptographicHash &other)
noexcept { qt_ptr_swap(d, other.d); }
72 void reset()
noexcept;
73 [[nodiscard]] Algorithm algorithm()
const noexcept;
75#if QT_DEPRECATED_SINCE(6
, 4
)
76 QT_DEPRECATED_VERSION_X_6_4(
"Use the QByteArrayView overload instead")
77 void addData(
const char *data, qsizetype length);
79#if QT_CORE_REMOVED_SINCE(6
, 3
)
80 void addData(
const QByteArray &data);
82 void addData(QByteArrayView data)
noexcept;
83 bool addData(QIODevice *device);
85 QByteArray result()
const;
86 QByteArrayView resultView()
const noexcept;
88#if QT_CORE_REMOVED_SINCE(6
, 3
)
89 static QByteArray hash(
const QByteArray &data, Algorithm method);
91 static QByteArray hash(QByteArrayView data, Algorithm method);
93 static QByteArrayView hashInto(QSpan<
char> buffer, QByteArrayView data, Algorithm method)
noexcept
94 {
return hashInto(as_writable_bytes(buffer), {&data, 1}, method); }
95 static QByteArrayView hashInto(QSpan<uchar> buffer, QByteArrayView data, Algorithm method)
noexcept
96 {
return hashInto(as_writable_bytes(buffer), {&data, 1}, method); }
97 static QByteArrayView hashInto(QSpan<std::byte> buffer, QByteArrayView data, Algorithm method)
noexcept
98 {
return hashInto(buffer, {&data, 1}, method); }
99 static QByteArrayView hashInto(QSpan<
char> buffer, QSpan<
const QByteArrayView> data, Algorithm method)
noexcept
100 {
return hashInto(as_writable_bytes(buffer), data, method); }
101 static QByteArrayView hashInto(QSpan<uchar> buffer, QSpan<
const QByteArrayView> data, Algorithm method)
noexcept
102 {
return hashInto(as_writable_bytes(buffer), data, method); }
103 static QByteArrayView hashInto(QSpan<std::byte> buffer, QSpan<
const QByteArrayView> data, Algorithm method)
noexcept;
105 static int hashLength(Algorithm method);
106 static bool supportsAlgorithm(Algorithm method);
108 Q_DISABLE_COPY(QCryptographicHash)
109 QCryptographicHashPrivate *d;