Skip to content
Snippets Groups Projects
Commit 30ae92e1 authored by David Sehnal's avatar David Sehnal
Browse files

uuid tweak

parent 113ce789
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ namespace UUID {
chars[i] = String.fromCharCode((d + Math.random()*0xff)%0xff | 0);
d = Math.floor(d/0xff);
}
return btoa(chars.join('')).substr(0, 22) as UUID;
return btoa(chars.join('')).replace(/\+/g, '-').replace(/\//g, '_').substr(0, 22) as UUID;
// const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
// const r = (d + Math.random()*16)%16 | 0;
// d = Math.floor(d/16);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment