I need to link together sqlite database with unique external files. To ensure this, I made a table that stores a hash of file and encountered the following problem - QCryptographicHash::Md5 result is not the same as bash md5sum result. Can anyone says what i'm doing wrong? My code:
int main(int argc, char *argv[]) {
QFile file(argv[0]);
if (!file.open(QIODevice::ReadOnly)) return -1;
QByteArray byteArray = file.readAll();
QByteArray md5=QCryptographicHash::hash(byteArray,QCryptographicHash::Md5);
qDebug()<<md5.toHex();
return 0;
}
Or maybe someone knows another solution of my problem? Using BLOB does not offer