Thanks for the hint, but it doesn't work for me! The md5 sum from image and dvd are not the same! On command line they are identical! Or is the code wrong?
QCryptographicHash hash(QCryptographicHash::Md5);
char buf[2048];
while (in.read(buf, 2048) > 0) {
hash.addData(buf, 2048);
}
in.close();
qDebug() << hash.result().toHex();
}
else {
qDebug() << "Failed to open device!";
}
QCryptographicHash hash(QCryptographicHash::Md5);
QFile in("/dev/cdrom");
if (in.open(QIODevice::ReadOnly)) {
char buf[2048];
while (in.read(buf, 2048) > 0) {
hash.addData(buf, 2048);
}
in.close();
qDebug() << hash.result().toHex();
}
else {
qDebug() << "Failed to open device!";
}
To copy to clipboard, switch view to plain text mode
Bookmarks