summaryrefslogtreecommitdiffstats
path: root/src/shared/util.cpp
blob: d5c101e7442408e136ca63fa874bd3b8bc352f7b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * util.cpp
 *
 *  Created on: 30.01.2013
 *      Author: sr
 */

#include "util.h"
#include <QCryptographicHash>

static QCryptographicHash sha1(QCryptographicHash::Sha1);

QByteArray genSha1(const QByteArray* a, const QByteArray* b, const QByteArray* c, const QByteArray* d, const QByteArray* e)
{
	sha1.reset();
	sha1.addData(*a);
	if (b) sha1.addData(*b);
	if (c) sha1.addData(*c);
	if (d) sha1.addData(*d);
	if (e) sha1.addData(*e);
	return sha1.result();
}