Hi,
Given the following code:
Qt Code:
QCryptographicHash hash(QCryptographicHash::Sha1); hash.addData(data_to_hash); qDebug(hash.result().toHex());To copy to clipboard, switch view to plain text mode
I get a hash of 4f20c649228a94d3cc4d31e9d12ec593e20c0202
However... the sha1sum program gives me the following:
...]$ echo "test_data" | sha1sum
45109238d9ab2fac4e954d1b38dc032cf2de629a
I'm probably being incredibly stupid here, but why don't the hash values match? Does qt do some kind of input conversion behind the scenes, or use a salt or something?
Thanks,
Jack
Bookmarks