Skip to content

Commit

Permalink
fix: use msCrypto if available. Fixes #241 (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
broofa authored Jan 15, 2018
1 parent 815daa3 commit 1fef18b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rng-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// and inconsistent support for the `crypto` API. We do the best we can via
// feature-detection

var getRandomValues = typeof(crypto) != 'undefined' && crypto.getRandomValues;

var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues) ||
(typeof(msCrypto) != 'undefined' && msCrypto.getRandomValues);
if (getRandomValues) {
// WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
Expand Down

0 comments on commit 1fef18b

Please sign in to comment.