Emil Bay
7 years ago
No known key found for this signature in database
GPG Key ID: AF1CF37B90FBF638
2 changed files with
4 additions and
3 deletions
-
README.md
-
index.js
|
|
@ -27,7 +27,7 @@ blake2b(output, input) |
|
|
|
|
|
|
|
## API |
|
|
|
|
|
|
|
### `blake2b(out, input, [key], [salt], [personal], [noAssert = false])` |
|
|
|
### `var out = blake2b(out, input, [key], [salt], [personal], [noAssert = false])` |
|
|
|
|
|
|
|
Hash `input` and write result to `out`, optionally with `key`, `salt` and |
|
|
|
`personal`. Bypass input assertions by setting `noAssert` to `true`. |
|
|
@ -55,12 +55,12 @@ data. `noAssert` will also disable asserts in `.update` and `.final` methods. |
|
|
|
Note that `outlen` should be a number, and that you pass the `Buffer` in the |
|
|
|
`.final` method |
|
|
|
|
|
|
|
### `instance.update(input)` |
|
|
|
### `var instance = instance.update(input)` |
|
|
|
|
|
|
|
Update the hash with new `input`. Calling this method after `.final` will throw |
|
|
|
an error. |
|
|
|
|
|
|
|
### `instance.final(out)` |
|
|
|
### `var out = instance.final(out)` |
|
|
|
|
|
|
|
Finalise the the hash and write the digest to `out`. `out` must be exactly equal |
|
|
|
to `outlen` given in the `.instance` method. |
|
|
|
|
|
@ -280,6 +280,7 @@ module.exports.instance = function instance (outlen, key, salt, personal, noAsse |
|
|
|
} |
|
|
|
|
|
|
|
blake2bUpdate(ctx, input) |
|
|
|
return this |
|
|
|
}, |
|
|
|
final: function (out) { |
|
|
|
if (noAssert !== true) { |
|
|
|