new Hash()
Methods
digest(encodingopt) → {string}
Calculates the digest of the data passed to this object.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
encoding | string | <optional> | Optional encoding of the output. |
- Version
- Experimental feature, might be removed at any time
Returns:
If no encoding is given, an array of integers is returned, otherwise a string with the given encoding.
- Type:
- string
hash(data, inputEncodingopt, outputEncodingopt) → {string}
Hashes the given data. This is a shorthand for calling reset, update and digest and changes the object state.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data | string | The data to hash. | |
inputEncoding | string | <optional> | Optional input encoding. |
outputEncoding | string | <optional> | Optional output encoding. |
- Version
- Experimental feature, might be removed at any time
Returns:
The hashed data as array of integers.
- Type:
- string
reset() → {$k.Hash}
Resets the hash to its initial state.
- Version
- Experimental feature, might be removed at any time
Returns:
The hash itself.
- Type:
- $k.Hash
update(data, encodingopt) → {$k.Hash}
Adds the given data to the hash.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data | string | The data to hash. | |
encoding | string | <optional> | Optional input encoding. |
- Version
- Experimental feature, might be removed at any time
Returns:
The hash object itself.
- Type:
- $k.Hash