From: Ivailo Monev Date: Fri, 11 Mar 2022 22:16:43 +0000 (+0200) Subject: read the file in chunks from filehash utility X-Git-Tag: 4.12.0~760 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f1bbf0c42e357faace5ef4507229c49761424df2;p=kde%2FKatie.git read the file in chunks from filehash utility Signed-off-by: Ivailo Monev --- diff --git a/util/filehash/main.cpp b/util/filehash/main.cpp index 22681122b..01743ca2d 100644 --- a/util/filehash/main.cpp +++ b/util/filehash/main.cpp @@ -32,7 +32,7 @@ int main(int argc, char *argv[]) const QStringList args = app.arguments().mid(1); if (args.size() != 2) { - qWarning() << "Usage: imgconv "; + qWarning() << "Usage: filehash "; return 1; } @@ -58,7 +58,9 @@ int main(int argc, char *argv[]) return 3; } - const QByteArray hash = QCryptographicHash::hash(file.readAll(), algorithm).toHex(); + QCryptographicHash cryptohash(algorithm); + cryptohash.addData(&file); + const QByteArray hash = cryptohash.result().toHex(); if (hash.isEmpty()) { qWarning() << "Could not hash" << args.at(1); return 4;