1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-03 23:50:33 +02:00
Files
joplin/QtClient/JoplinQtClient/uuid.cpp

15 lines
323 B
C++
Raw Normal View History

2016-12-10 22:39:53 +00:00
#include <stable.h>
#include "uuid.h"
namespace jop {
namespace uuid {
2016-12-31 10:48:18 +01:00
QString createUuid(QString s) {
if (s == "") s = QString("%1%2").arg(qrand()).arg(QDateTime::currentMSecsSinceEpoch());
QString hash = QString(QCryptographicHash::hash(s.toUtf8(), QCryptographicHash::Sha256).toHex());
return hash.left(32);
}
2016-12-10 22:39:53 +00:00
}
}