summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qcryptographichash.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2021-07-05 20:10:07 +0200
committerMarc Mutz <marc.mutz@kdab.com>2021-07-06 16:30:52 +0200
commitde18b3ff370543b5b99bd068b871a2cd677cf9f3 (patch)
tree2cd67bd934657e2ce92a08af00e73e604d86f02b /src/corelib/tools/qcryptographichash.h
parent85831bcfe6ce36740c524d641ada79c65aadd89b (diff)
QCryptographicHash: port addData() to QByteArrayView
Incl. the static hash() function. Remove the QByteArray versions from the API, but not the ABI. Adapt some callers. [ChangeLog][QtCore][QCryptographicHash] Replaced QByteArray with QByteArrayView in addData() and static hash() functions. Change-Id: Ia0e9bf726276305e05894d323d76a29e985f39eb Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/tools/qcryptographichash.h')
-rw-r--r--src/corelib/tools/qcryptographichash.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/tools/qcryptographichash.h b/src/corelib/tools/qcryptographichash.h
index 4d76d06e59..aecf8995d5 100644
--- a/src/corelib/tools/qcryptographichash.h
+++ b/src/corelib/tools/qcryptographichash.h
@@ -1,5 +1,6 @@
/****************************************************************************
**
+** Copyright (C) 2021 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2013 Richard J. Moore <rich@kde.org>.
** Contact: https://www.qt.io/licensing/
@@ -103,13 +104,22 @@ public:
void reset();
+#if QT_DEPRECATED_SINCE(6, 4)
+ QT_DEPRECATED_VERSION_X_6_4("Use the QByteArrayView overload instead")
void addData(const char *data, qsizetype length);
+#endif
+#ifdef QT_BUILD_FUNCTIONS_REMOVED_IN_6_3
void addData(const QByteArray &data);
+#endif
+ void addData(QByteArrayView data) noexcept;
bool addData(QIODevice *device);
QByteArray result() const;
+#ifdef QT_BUILD_FUNCTIONS_REMOVED_IN_6_3
static QByteArray hash(const QByteArray &data, Algorithm method);
+#endif
+ static QByteArray hash(QByteArrayView data, Algorithm method);
static int hashLength(Algorithm method);
private:
Q_DISABLE_COPY(QCryptographicHash)