ATLAS Offline Software
Loading...
Searching...
No Matches
VP1MD5Sum.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5
7// //
8// Header file for class VP1MD5Sum //
9// //
10// Description: Calculates md5sum of file without reading //
11// entire file into memory at once. //
12// //
13// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
14// Initial version: May 2008 //
15// //
17
18#ifndef VP1MD5SUM_H
19#define VP1MD5SUM_H
20
21#include <QString>
22#include <QByteArray>
23
24class VP1MD5Sum {
25public:
26
27 static QByteArray sum( const QString& filename );
28 //Returns empty array in case of errors
29
30 static bool sumMatches( const QString& filename, const QByteArray& md5sum );
31 static bool sumMatches( const QString& filename, const QString& md5sum );
32 //Returns false in case of errors (missing or unreadable file/empty md5sum) or mismatch.
33
34 //We always assume sums in byte arrays to be raw bits, and sums in
35 //strings to be in hex format. Here are methods for
36 //conversion/sanity checking:
37 static QString sumToString(const QByteArray& );
38 static QByteArray sumToByteArray(const QString& );
39 static bool validMD5Sum(const QString&);//Does string have correct length and contain no invalid characters?
40 static QString sumToStandardFormat(const QString&);//Removes spaces converts to lower case.
41private:
42 class Imp;
45};
46
47#endif
static bool validMD5Sum(const QString &)
Definition VP1MD5Sum.cxx:88
static QByteArray sumToByteArray(const QString &)
Definition VP1MD5Sum.cxx:82
static QByteArray sum(const QString &filename)
Definition VP1MD5Sum.cxx:28
static QString sumToString(const QByteArray &)
Definition VP1MD5Sum.cxx:76
static QString sumToStandardFormat(const QString &)
Definition VP1MD5Sum.cxx:96
static bool sumMatches(const QString &filename, const QByteArray &md5sum)
Definition VP1MD5Sum.cxx:38