Update utils.js

This commit is contained in:
robbielj 2014-03-14 13:57:57 +01:00
parent 9e0673f077
commit 59c66a211a

View File

@ -11,7 +11,7 @@ angular.module('webui.services.utils', [])
return rndBuffer; return rndBuffer;
}; };
if (!window.crypto || !crypto.getRandomValues) { if (!window.crypto || !crypto.getRandomValues) {
return rnd16Weak; return rnd16Weak;
} }
return function() { return function() {
@ -82,7 +82,7 @@ angular.module('webui.services.utils', [])
return function() { return function() {
var r = rnd16(); var r = rnd16();
r[6] = (r[6] & 0xf) | 0x40; // Version 4 r[6] = (r[6] & 0xf) | 0x40; // Version 4
r[8] = (r[8] & 0x3f) | 0x80; // Version 4y r[8] = (r[8] & 0x3f) | 0x80; // Version 4y
return bt[r[0]] + bt[r[1]] + bt[r[2]] + bt[r[3]] + "-" + return bt[r[0]] + bt[r[1]] + bt[r[2]] + bt[r[3]] + "-" +
bt[r[4]] + bt[r[5]] + "-" + bt[r[4]] + bt[r[5]] + "-" +
bt[r[6]] + bt[r[7]] + "-" + bt[r[6]] + bt[r[7]] + "-" +