md5sum.h
/*
*openPilotLog - A FOSS Pilot Logbook Application
*Copyright (C) 2020-2022 Felix Turowsky
*
*This program is free software: you can redistribute it and/or modify
*it under the terms of the GNU General Public License as published by
*the Free Software Foundation, either version 3 of the License, or
*(at your option) any later version.
*
*This program is distributed in the hope that it will be useful,
*but WITHOUT ANY WARRANTY; without even the implied warranty of
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*GNU General Public License for more details.
*
*You should have received a copy of the GNU General Public License
*along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef MD5SUM_H
#define MD5SUM_H
#include <QtCore>
#include <QByteArray>
#include <QCryptographicHash>
class Md5Sum
{
public:
Md5Sum(QFileInfo &file_info);
Md5Sum() = delete;
QByteArray checksum;
inline const QString hashToHex() const
{
return QString(checksum.toHex());
};
bool compare(QFileInfo &md5_file) const;
};
#endif // MD5SUM_H
Md5Sum
The Md5Sum class is responsible for calculating cryptographic hashes of files (used to verify downloa...
Definition: md5sum.h:28
Md5Sum::compare
bool compare(QFileInfo &md5_file) const
compare reads the pre-calculated md5-sum from a checkfile and compares the hashes.
Definition: md5sum.cpp:39
Md5Sum::hashToHex
const QString hashToHex() const
hashString returns a hex representation of the hash
Definition: md5sum.h:42