util.uuid: Take random byte directly instead of the low bits from the ascii value...
authorKim Alvefur <zash@zash.se>
Wed, 6 Jan 2016 02:28:31 +0000 (03:28 +0100)
committerKim Alvefur <zash@zash.se>
Wed, 6 Jan 2016 02:28:31 +0000 (03:28 +0100)
util/uuid.lua

index e10fc0f72290a996c09560632e4c94603dff74fb..f4fd21f64ec72b9fc3e45f2973c9a1d9d9fabeff 100644 (file)
@@ -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()