Changeset

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
parents 7047:9ca2b720ad43
children 7050:ae044691de0f
files util/uuid.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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()