Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Create a new hash instance. `digestLength` defaults to `32`.

Update the hash with a new piece of data. `data` should be a buffer or uint8array.

The size of the data is limited to `65536000 - 64 - 216*n` bytes, where `n` is the number of Blake2b instances.

#### `var digest = hash.digest([enc])`

Digest the hash.
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Blake2b.prototype._realloc = function (size) {
Blake2b.prototype.update = function (input) {
assert(this.finalized === false, 'Hash instance finalized')
assert(input instanceof Uint8Array, 'input must be Uint8Array or Buffer')
assert(input.length + head <= 65536000, 'input + head must be of size 65,536,000 or less')

if (head + input.length > this._memory.length) this._realloc(head + input.length)
this._memory.set(input, head)
Expand Down