Skip to content
This repository has been archived by the owner on Jul 28, 2021. It is now read-only.

Commit

Permalink
Provide support of MSIE 11 msCrypto
Browse files Browse the repository at this point in the history
  • Loading branch information
danorton-cubic-austin committed Mar 17, 2015
1 parent bfce984 commit da999e9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions uuid.js
Expand Up @@ -11,6 +11,9 @@
// returns 128-bits of randomness, since that's what's usually required
var _rng;

// Allow for MSIE11 msCrypto
var _crypto = _global.crypto || _global.msCrypto;

// Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html
//
// Moderately fast, high quality
Expand All @@ -21,13 +24,13 @@
} catch(e) {}
}

if (!_rng && _global.crypto && crypto.getRandomValues) {
if (!_rng && _crypto && _crypto.getRandomValues) {
// WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto
//
// Moderately fast, high quality
var _rnds8 = new Uint8Array(16);
_rng = function whatwgRNG() {
crypto.getRandomValues(_rnds8);
_crypto.getRandomValues(_rnds8);
return _rnds8;
};
}
Expand Down

0 comments on commit da999e9

Please sign in to comment.