Class R.util.FNV1Hash
Extends
R.engine.PooledObject.
A class for creating a hash value from a string. Calling the #getHash method resets
the hash each time a new source string is provided, whereas evolving the hash will build upon
previous hashes. The hash for a string will always be the same. Hashing a set of strings, in
order, will always result in the same evolved hash. Uses the R.lang.FNV1a32 hashing
routine by default.
Defined in: fnv1hash.js.
Constructor Attributes | Constructor Name and Description |
---|---|
R.util.FNV1Hash(hashRoutine)
|
Method Attributes | Method Name and Description |
---|---|
getHash(str)
Initialize the hasher with the provided string.
|
|
Get the last returned hash value without evolving the hash.
|
|
release()
Release the hash back into the pool for later use.
|
|
updateHash(str)
Evolves the existing hash.
|
- Methods borrowed from class R.engine.PooledObject:
- clearObjectDataModel, destroy, getId, getName, getObjectDataModel, getProperties, isDestroyed, setName, setObjectDataModel, toString, toXML
Class Detail
R.util.FNV1Hash(hashRoutine)
- Parameters:
- hashRoutine Optional, Default: R.lang.FNV1a32
- {FNV1} The hash routine to use.
Method Detail
{String}
getHash(str)
Initialize the hasher with the provided string. To instead evolve the hash
use the #updateHash to update the hash with new data.
- Parameters:
- str
- {String} The value to get the hash for
- Returns:
- {String} A hexadecimal hash value
{String}
getLastHash()
Get the last returned hash value without evolving the hash.
- Returns:
- {String} A hexadecimal hash value
release()
Release the hash back into the pool for later use.
{String}
updateHash(str)
Evolves the existing hash.
- Parameters:
- str
- {String} The value to get the hash for
- Returns:
- {String} A hexadecimal hash value