diff options
Diffstat (limited to 'src/common/uuid.cpp')
| -rw-r--r-- | src/common/uuid.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common/uuid.cpp b/src/common/uuid.cpp index d4a5733c26..51fe0abaa5 100644 --- a/src/common/uuid.cpp +++ b/src/common/uuid.cpp @@ -208,4 +208,12 @@ UUID UUID::MakeRandomRFC4122V4() { return uuid; } +UUID UUID::MakeRFC4122V5(std::span<u8, 20> sha1) { + UUID uuid{}; + std::memcpy(&uuid.uuid, sha1.data(), sizeof(UUID)); + uuid.uuid[8] = 0x80 | (uuid.uuid[8] & 0x3F); + uuid.uuid[6] = 0x50 | (uuid.uuid[6] & 0xF); + return uuid; +} + } // namespace Common |
