aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-01-06 03:28:31 +0100
committerKim Alvefur <zash@zash.se>2016-01-06 03:28:31 +0100
commitc515c93724a691a3fdbcc97e7684c09fbeaa338f (patch)
treef8047bc5f26c180e0ebb9dc662d8558a278aaf59
parent3937d883586e89b5dd6c0da332bf290158a6ecb1 (diff)
downloadprosody-c515c93724a691a3fdbcc97e7684c09fbeaa338f.tar.gz
prosody-c515c93724a691a3fdbcc97e7684c09fbeaa338f.zip
util.uuid: Take random byte directly instead of the low bits from the ascii value of a hex nibble
-rw-r--r--util/uuid.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/uuid.lua b/util/uuid.lua
index e10fc0f7..f4fd21f6 100644
--- a/util/uuid.lua
+++ b/util/uuid.lua
@@ -16,7 +16,7 @@ local function get_nibbles(n)
end
local function get_twobits()
- return ("%x"):format(get_nibbles(1):byte() % 4 + 8);
+ return ("%x"):format(random_bytes(1):byte() % 4 + 8);
end
local function generate()