kDB: Knowledge DataBase
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) {}
17 using QCryptographicHash::addData;
18
19 void addData(const QUuid& _uuid) { addData(_uuid.toByteArray()); }
20 void addData(const QDateTime& _time) { addData(_time.toMSecsSinceEpoch()); }
21 template<typename _T_>
22 requires(std::is_fundamental_v<_T_>)
23 void addData(_T_ _t)
24 {
25 addData(reinterpret_cast<char*>(&_t), sizeof(_t));
26 }
27 };
28} // namespace knowCore
Definition CryptographicHash.h:13