openPilotLog
ahash.h
1 #ifndef AHASH_H
2 #define AHASH_H
3 #include <QtCore>
4 #include <QByteArray>
5 #include <QCryptographicHash>
6 
10 class AHash
11 {
12 public:
17  AHash(QFile &file);
18 
19  AHash(QFileInfo &file_info);
20 
21  QByteArray checksum;
22 
26  inline const QString hashToHex()
27  {
28  return QString(checksum.toHex());
29  };
30 
36  bool compare(QFileInfo &md5_file);
37 };
38 
39 #endif // AHASH_H
AHash::compare
bool compare(QFileInfo &md5_file)
compare reads the pre-calculated md5-sum from a checkfile and compares the hashes.
Definition: ahash.cpp:39
AHash::AHash
AHash(QFile &file)
AHash - calculates the MD5-checksum for the parameter given in the constructor and saves the result i...
Definition: ahash.cpp:4
AHash::hashToHex
const QString hashToHex()
hashString returns a hex representation of the hash
Definition: ahash.h:26
AHash
The AHash class is responsible for calculating cryptographic hashes of files (used to verify download...
Definition: ahash.h:10