knowL: Knowledge Libraries
Loading...
Searching...
No Matches
CryptographicHash.h
1#pragma once
2
3#include <QCryptographicHash>
4#include <QDateTime>
5#include <QUuid>
6
7namespace knowCore
8{
12 class CryptographicHash : public QCryptographicHash
13 {
14 public:
15 explicit CryptographicHash(Algorithm method) : QCryptographicHash(method)
16 {
17 }
19 {
20 }
21 using QCryptographicHash::addData;
22
23 void addData(const QUuid& _uuid)
24 {
25 addData(_uuid.toByteArray());
26 }
27 void addData(const QDateTime& _time)
28 {
29 addData(_time.toMSecsSinceEpoch());
30 }
31 template<typename _T_, typename std::enable_if_t<std::is_fundamental<_T_>::value, int> = 0>
32 void addData(_T_ _t)
33 {
34 addData(reinterpret_cast<char*>(&_t), sizeof(_t));
35 }
36 };
37}
Definition CryptographicHash.h:13