randomness in Chrome
This commit is contained in:
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…
Reference in New Issue
Block a user