Mercurial > prosody-hg
changeset 14035:dab1a4002cb5 13.0
util.uuid: Fix padding of group 2 of UUIDv7 to use zeroes
string.format("%4x", 0x1a) --> " a1"
Caused tests to fail sporadically but only happened for about 4 seconds
every minute.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 12 Jan 2026 07:05:40 +0100 |
| parents | fe024a5be7e6 |
| children | 7915d8c519a1 cc916272c30f |
| files | util/uuid.lua |
| diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/util/uuid.lua Mon Jan 12 06:47:50 2026 +0100 +++ b/util/uuid.lua Mon Jan 12 07:05:40 2026 +0100 @@ -32,7 +32,7 @@ local unix_ts_ms = m_floor(time.now()*1000); local unix_ts_ms_a = m_floor(unix_ts_ms / 0x10000); local unix_ts_ms_b = unix_ts_ms % 0x10000; - return ("%08x-%4x-7%3s-%1s%3s-%12s"):format(unix_ts_ms_a, unix_ts_ms_b, get_nibbles(3), get_twobits(), get_nibbles(3), get_nibbles(12)); + return ("%08x-%04x-7%3s-%1s%3s-%12s"):format(unix_ts_ms_a, unix_ts_ms_b, get_nibbles(3), get_twobits(), get_nibbles(3), get_nibbles(12)); end return {
