Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QUuid QUuid::createUuidV3OrV5(const QUuid &ns, const QByteArray &name, Version v)
- {
- QUuid result;
- QByteArray tmp;
- {
- QCryptographicHash hash(QCryptographicHash::Md5);
- hash.addData(ns.toRfc4122());
- hash.addData(name);
- tmp = hash.result();
- tmp.resize(16);
- }
- result = QUuid::fromRfc4122(tmp);
- result.data3 &= 0x0FFF;
- result.data3 |= ((int)v << 12);
- result.data4[0] &= 0x3F;
- result.data4[0] |= 0x80;
- return result;
- }
Add Comment
Please, Sign In to add comment