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
,salt
andpersonal
. Bypass input assertions by settingnoAssert
totrue
.All parameters must fulfill the following constraints, or an
AssertionError
will be thrown (unlessnoAssert = true
):outLength
must within the byte ranges defined by the constants below.key
is 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.salt
is 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.personal
is 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.