randomness in Chrome

pull/17/head
Mike Hamburg 13 years ago
parent 8d3a6e7ded
commit c1fcb9a560

@ -366,3 +366,13 @@ sjcl.random = {
}
};
(function(){
try {
// get cryptographically strong entropy in Webkit
var ab = new Uint32Array(32), i;
crypto.getRandomValues(ab);
sjcl.random.addEntropy(ab, 1024, "crypto.getRandomValues");
} catch (e) {
// no getRandomValues :-(
}
})();

Loading…
Cancel
Save