random-uuid-v4
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "random-uuid-v4", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "A lightweight version 4 UUID generator.", | ||
@@ -5,0 +5,0 @@ "main": "uuidv4.js", |
@@ -11,3 +11,3 @@ /** | ||
module.exports = function() { | ||
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | ||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | ||
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); | ||
@@ -14,0 +14,0 @@ return v.toString(16); |
1181