From c515c93724a691a3fdbcc97e7684c09fbeaa338f Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 6 Jan 2016 03:28:31 +0100 Subject: util.uuid: Take random byte directly instead of the low bits from the ascii value of a hex nibble --- util/uuid.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() -- cgit v1.2.3