rand: fix uuid_v7 seperator (#24348)

This commit is contained in:
kbkpbot 2025-04-28 14:54:51 +08:00 committed by GitHub
parent 5fb27ac35a
commit 649041c8b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -48,9 +48,9 @@ fn internal_uuid(version u8, rand_1 u64, rand_2 u64) string {
buf[start + 2] = hex_chars[(val >> 4) & 0xF] buf[start + 2] = hex_chars[(val >> 4) & 0xF]
buf[start + 3] = hex_chars[val & 0xF] buf[start + 3] = hex_chars[val & 0xF]
start += 4 start += 4
// insert `_` at specified locations // insert `-` at specified locations
if start in [8, 13, 18, 23]! { if start in [8, 13, 18, 23]! {
buf[start] = `_` buf[start] = `-`
start++ start++
} }
} }