Add network remote WIP

This commit is contained in:
Jonas Kvinge
2024-12-03 18:34:11 +01:00
parent da2f28811a
commit 784c86aa80
45 changed files with 5320 additions and 9 deletions

View File

@@ -20,6 +20,8 @@
#include <QByteArray>
#include <QString>
#include <QCryptographicHash>
#include <QFile>
#include <QIODevice>
#include "cryptutils.h"
@@ -62,4 +64,17 @@ QByteArray HmacSha1(const QByteArray &key, const QByteArray &data) {
return Hmac(key, data, QCryptographicHash::Sha1);
}
QByteArray Sha1File(QFile &file) {
file.open(QIODevice::ReadOnly);
QCryptographicHash hash(QCryptographicHash::Sha1);
while (!file.atEnd()) {
hash.addData(file.read(1000000));
}
file.close();
return hash.result();
}
} // namespace Utilities