Skip to content

Commit 1fef18b

Browse files
authored
fix: use msCrypto if available. Fixes #241 (#247)
1 parent 815daa3 commit 1fef18b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/rng-browser.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// and inconsistent support for the `crypto` API. We do the best we can via
44
// feature-detection
55

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

0 commit comments

Comments
 (0)