PDA

View Full Version : Checksum generation (used to compare two or more files)



comlink21
22nd August 2007, 04:04
please help,
i have to compare both file from diferent client whether same or not. currently i use QProcess::start() to run cksum command (actually linux command) to check file checksum but this methode took sometime.

does anyone has simple and accurate method on how to compare the file..?
if possible please copy the code,
thanks for help
--comlink21

ChristianEhrlicher
22nd August 2007, 06:52
Read both files into memory and check with QCryptographicHash (http://doc.trolltech.com/4.3/qcryptographichash)

jpn
22nd August 2007, 08:28
Or use qChecksum() (http://doc.trolltech.com/latest/qbytearray.html#qChecksum) instead of launching external processes.