Blake2b.prototype.final = Blake2b.prototype.digest
-Blake2b.ready = function (cb) {
- b2wasm.ready(function () {
- cb() // ignore the error
- })
-}
-
// Updates a BLAKE2b streaming hash
// Requires hash context and Uint8Array (byte array)
function blake2bUpdate (ctx, input) {
var Proto = Blake2b
-module.exports = function createHash (outlen, key, salt, personal, noAssert) {
+export default function createHash (outlen, key?, salt?, personal?, noAssert?) {
if (noAssert !== true) {
if (outlen < BYTES_MIN)
throw new RangeError('outlen must be at least ' + BYTES_MIN + ', was given ' + outlen)
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 = 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
- }
-})