Merge pull request #269 from dconnolly/mscrypto
If browser `crypto` is not available, try `msCrypto` before assuming a Node environment.
This commit is contained in:
commit
b2dd3453d5
@ -60,7 +60,8 @@ randombytes_stir(void)
|
||||
EM_ASM({
|
||||
if (Module.getRandomValue === undefined) {
|
||||
try {
|
||||
var crypto_ = ("object" === typeof window ? window : self).crypto,
|
||||
var window_ = "object" === typeof window ? window : self,
|
||||
crypto_ = typeof window_.crypto !== "undefined" ? window_.crypto : window_.msCrypto,
|
||||
randomValuesStandard = function() {
|
||||
var buf = new Uint32Array(1);
|
||||
crypto_.getRandomValues(buf);
|
||||
|
Loading…
Reference in New Issue
Block a user