Optional key: Uint8ArrayOptional salt: Uint8ArrayOptional personal: Uint8ArrayOptional noAssert: booleanfalse
import blake2b = require('blake2b')
const output = new Uint8Array(64)
const input = Buffer.from('hello world')
console.log('hash:', blake2b(output.length).update(input).digest('hex'))
Generated using TypeDoc
Create a new hash instance, optionally with
key,saltandpersonal. Bypass input assertions by settingnoAsserttotrue.All parameters must fulfill the following constraints, or an
AssertionErrorwill be thrown (unlessnoAssert = true):outLengthmust within the byte ranges defined by the constants below.keyis optional, but must within the byte ranges defined by the constants below, if given. This value must be kept secret, and can be used to create prefix-MACs.saltis optional, but must be exactlySALTBYTES, if given. You can use this parameter as a kind of per user id, or local versioning scheme. This value is not required to be secret.personalis optional, but must be exactlyPERSONALBYTES, if given. You can use this parameter as a kind of app id, or global versioning scheme. This value is not required to be secret.