summaryrefslogtreecommitdiffstats
path: root/src/shared/util.cpp
diff options
context:
space:
mode:
authorsr2013-02-04 19:50:31 +0100
committersr2013-02-04 19:50:31 +0100
commit1a5709501f94014d41987b956338bb6424b9f90c (patch)
treed3b93fe8dc406bca56aff147ef5cc4cbf9ed6be0 /src/shared/util.cpp
parentTest (diff)
downloadpvs2-1a5709501f94014d41987b956338bb6424b9f90c.tar.gz
pvs2-1a5709501f94014d41987b956338bb6424b9f90c.tar.xz
pvs2-1a5709501f94014d41987b956338bb6424b9f90c.zip
Initial commit
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();
+}