From d7f33160807e094d0a42948f23023638a0cfbae1 Mon Sep 17 00:00:00 2001 From: MuldeR Date: Fri, 24 Mar 2017 20:36:52 +0100 Subject: [PATCH] Fixed hash computation with latest MUtils library. --- src/MainWindow.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 6d6ce1d..3c34b16 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include //Qt includes @@ -721,6 +721,7 @@ void CMainWindow::received(const quint32 &command, const QString &message) //////////////////////////////////////////////////////////// #define HAVE_SSE2(X) ((X).features & MUtils::CPUFetaures::FLAG_SSE2) +static const char *const HASH_SEED = "+A`~}vPe9'~#n+c1Wq/MPo;1XwY\\;Pb."; static bool VALIDATE_MEDIAINFO(QFile *const handle, const char *const expected_checksum) { @@ -730,9 +731,9 @@ static bool VALIDATE_MEDIAINFO(QFile *const handle, const char *const expected_c } //Compute Hash - MUtils::Hash::Blake2 hash("+A`~}vPe9'~#n+c1Wq/MPo;1XwY\\;Pb."); - hash.update(handle->readAll()); - const QByteArray checksum = hash.finalize(true); + QScopedPointer hash(MUtils::Hash::create(MUtils::Hash::HASH_BLAKE2_512, HASH_SEED)); + hash->update(handle->readAll()); + const QByteArray checksum = hash->digest(true); //Compare Hash if(qstricmp(checksum.constData(), expected_checksum) != 0)