From: Chris Duncan Date: Tue, 26 Nov 2024 20:01:33 +0000 (-0800) Subject: Remove deprecated blake2b-wasm references. X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=4fd48443d706e90881193dc8c2905da2d430d1c7;p=libnemo.git Remove deprecated blake2b-wasm references. --- diff --git a/src/lib/blake2b.ts b/src/lib/blake2b.ts index 2e797c0..78fea34 100644 --- a/src/lib/blake2b.ts +++ b/src/lib/blake2b.ts @@ -241,12 +241,6 @@ Blake2b.prototype.digest = function (out) { 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) { @@ -289,7 +283,7 @@ function toHex (n) { 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) @@ -320,15 +314,6 @@ module.exports = function createHash (outlen, key, salt, personal, noAssert) { 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 @@ -337,10 +322,3 @@ 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 - } -})