summaryrefslogtreecommitdiffstats
path: root/src/shared/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/util.cpp')
-rw-r--r--src/shared/util.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/shared/util.cpp b/src/shared/util.cpp
new file mode 100644
index 0000000..d5c101e
--- /dev/null
+++ b/src/shared/util.cpp
@@ -0,0 +1,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();
+}