randomness in Chrome
This commit is contained in:
parent
8d3a6e7ded
commit
c1fcb9a560
1 changed files with 10 additions and 0 deletions
|
@ -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 a new issue