Diff

util/uuid.lua @ 7049:0eee56075901

util.uuid: Take random byte directly instead of the low bits from the ascii value of a hex nibble
author Kim Alvefur <zash@zash.se>
date Wed, 06 Jan 2016 03:28:31 +0100
parent 7012:990b4ddaf582
child 7061:eda0feeaf759
line wrap: on
line diff
--- a/util/uuid.lua	Mon Jan 04 09:14:30 2016 +0000
+++ b/util/uuid.lua	Wed Jan 06 03:28:31 2016 +0100
@@ -16,7 +16,7 @@
 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()