Details
-
Suggestion
-
Resolution: Done
-
P2: Important
-
5.0.0
-
None
-
8c72dc5907a97fce718f6810d446ecf6ea41b588
Description
We don't support md5(v3) and sha1(v5) method in QUuid yet, they are part of standard, rfc4122.
http://www.ietf.org/rfc/rfc4122.txt
And there is an implementation for md5(v3) in QtJsonDB,
src/qson/qsonuuid_p.h
Q_ADDON_JSONDB_QSON_EXPORT QByteArray QsonUUIDv3(const QString &source);
src/qson/qsonuuid.cpp
QByteArray QsonUUIDv3(const QString &source) { QCryptographicHash md5(QCryptographicHash::Md5); md5.addData((char *) &QsonUuidNs, sizeof(QsonUuidNs)); md5.addData((char *) source.constData(), source.size() * 2); QByteArray result = md5.result(); qson_uuid_t *uuid = (qson_uuid_t*) result.data(); uuid->time_hi_and_version &= 0x0FFF; uuid->time_hi_and_version |= (3 << 12); uuid->clock_seq_hi_and_reserved &= 0x3F; uuid->clock_seq_hi_and_reserved |= 0x80; return result; }