Browse Source

wasm may be null when async loading

master
Emil Bay 6 years ago
parent
commit
298c2884a1
No known key found for this signature in database GPG Key ID: AF1CF37B90FBF638
  1. 2
      index.js

2
index.js

@ -16,7 +16,7 @@ var PERSONALBYTES = module.exports.PERSONALBYTES = 16
function Blake2b (digestLength, key, salt, personal, noAssert) {
if (!(this instanceof Blake2b)) return new Blake2b(digestLength, key, salt, personal, noAssert)
if (!wasm.exports) throw new Error('WASM not loaded. Wait for Blake2b.ready(cb)')
if (!(wasm && wasm.exports)) throw new Error('WASM not loaded. Wait for Blake2b.ready(cb)')
if (!digestLength) digestLength = 32
if (noAssert !== true) {

Loading…
Cancel
Save