mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-27 10:32:58 +02:00
15 lines
323 B
C++
Executable File
15 lines
323 B
C++
Executable File
#include <stable.h>
|
|
#include "uuid.h"
|
|
|
|
namespace jop {
|
|
namespace uuid {
|
|
|
|
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);
|
|
}
|
|
|
|
}
|
|
}
|