Constructor
new UnorderedHasher(buildHasher, opts)
- Source:
- Implements:
- Hasher
- Shallowclone
- Deepclone
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
buildHasher |
function | Function that produces an instance of the inner buildHasher. Defaults to defaultBuildHasher(). You could use seededBuildHasher or randomBuildHasher too. |
||||||
opts |
Object | – Optional Properties
|
Methods
(static) fromBuildHasher(seed) → {UnorderedHasher}
- Source:
Version history
- 1.9.0 Initial implementation
Parameters:
Name | Type | Description |
---|---|---|
seed |
Uint8Array |
Returns:
- Type
- UnorderedHasher
(static) new() → {UnorderedHasher}
- Source:
Version history
- 1.9.0 Initial implementation
Returns:
- Type
- UnorderedHasher
(static) withOpts(opts) → {UnorderedHasher}
- Source:
Version history
- 1.9.0 Initial implementation
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
opts |
Object |
Properties
|
Returns:
- Type
- UnorderedHasher
buildHasher()
- Source:
- Implements:
Most tree-like structures are hashed directly into the main hasher; but in some cases this is not possible; e.g. order independent hashing – used in associative containers – require the calculation of intermediate hash values. For these cases hashers must provide the buildHasher property.
It must be a property (or a method with bound this).
Version history
- 1.9.0 Initial implementation
Returns:
Hasher
digest() → {Uint8Array}
- Source:
- Implements:
Produce a hash value from all the data supplied with update(). This may throw an error if digest() was called before.
Version history
- 1.9.0 Initial implementation
Returns:
- Type
- Uint8Array
update(v) → {Hasher}
- Source:
- Implements:
Add some more data to the hasher.
This may throw an error if digest() was called before.
Version history
- 1.9.0 Initial implementation
Parameters:
Name | Type | Description |
---|---|---|
v |
* |
Returns:
this, for chaining
- Type
- Hasher