Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (personal != null) {
assert(personal instanceof Uint8Array, 'personal must be Uint8Array or Buffer')
assert(personal.length === PERSONALBYTES, 'personal must be exactly ' + PERSONALBYTES + ', was given ' + personal.length)
}
}
return new Proto(outlen, key, salt, personal)
}
module.exports.ready = function (cb) {
b2wasm.ready(function () { // ignore errors
cb()
})
}
module.exports.WASM_SUPPORTED = b2wasm.SUPPORTED
module.exports.WASM_LOADED = false
var BYTES_MIN = module.exports.BYTES_MIN = 16
var BYTES_MAX = module.exports.BYTES_MAX = 64
var BYTES = module.exports.BYTES = 32
var KEYBYTES_MIN = module.exports.KEYBYTES_MIN = 16
var KEYBYTES_MAX = module.exports.KEYBYTES_MAX = 64
var KEYBYTES = module.exports.KEYBYTES = 32
var SALTBYTES = module.exports.SALTBYTES = 16
var PERSONALBYTES = module.exports.PERSONALBYTES = 16
b2wasm.ready(function (err) {
if (!err) {
module.exports.WASM_LOADED = true
module.exports = b2wasm
}
Blake2b.ready = function (cb) {
b2wasm.ready(function () {
cb() // ignore the error
})
}