Mercurial > prosody-hg
view util/bit53.lua @ 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 | 9912baa541c0 |
| children |
line wrap: on
line source
-- Only the operators needed by net.websocket.frames are provided at this point return { band = function (a, b, ...) local ret = a & b; if ... then for i = 1, select("#", ...) do ret = ret & (select(i, ...)); end end return ret; end; bor = function (a, b, ...) local ret = a | b; if ... then for i = 1, select("#", ...) do ret = ret | (select(i, ...)); end end return ret; end; bxor = function (a, b, ...) local ret = a ~ b; if ... then for i = 1, select("#", ...) do ret = ret ~ (select(i, ...)); end end return ret; end; bnot = function (x) return ~x; end; rshift = function (a, n) return a >> n end; lshift = function (a, n) return a << n end; };
