[#BloombergLP-bslh-SpookyHashAlgorithmImp] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslh.adoc[bslh]::SpookyHashAlgorithmImp :relfileprefix: ../../ :mrdocs: This class wraps an implementation of Bob Jenkin's "SpookyHash" in a BDE‐style component. For more information, see http://burtleburtle.net/bob/hash/spooky.html . == Synopsis Declared in `<bslh_spookyhashalgorithmimp.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class SpookyHashAlgorithmImp; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslh/SpookyHashAlgorithmImp/Uint16.adoc[`Uint16`] | 16‐bit unsigned integer type used by the implementation. | xref:BloombergLP/bslh/SpookyHashAlgorithmImp/Uint32.adoc[`Uint32`] | 32‐bit unsigned integer type used by the implementation. | xref:BloombergLP/bslh/SpookyHashAlgorithmImp/Uint64.adoc[`Uint64`] | 64‐bit unsigned integer type used by the implementation. | xref:BloombergLP/bslh/SpookyHashAlgorithmImp/Uint8.adoc[`Uint8`] | 8‐bit unsigned integer type used by the implementation. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslh/SpookyHashAlgorithmImp/2constructor.adoc[`SpookyHashAlgorithmImp`] [.small]#[constructor]# | Create a `bslh::SpookyHashAlgorithmImp`, initializing the internal state of the object using the specified `seed1` and `seed2` as seeds for the algorithm. | xref:BloombergLP/bslh/SpookyHashAlgorithmImp/finalize.adoc[`finalize`] | Load the finalized hash into the specified `hash1` and `hash2`. `hash1` will contain the higher order bits of the hash and `hash2` will contain the lower order bits. The internal state of the algorithm will be modified, meaning that calling final multiple times will result in different hash values being returned. The returned hash will be the same as if `Hash128` had been called will all of the accumulated data in one block. The behavior is undefined unless both `hash1` and `hash2` point to 8 bytes of modifiable memory. Note that a value will be returned even if `update` has not been called. | xref:BloombergLP/bslh/SpookyHashAlgorithmImp/update.adoc[`update`] | Accumulate the specified `length` bytes of `message` into the internal state of the algorithm. Accumulating bytes through `Update` will produce the same result as hashing them all at once through the `HashXX` static methods. The behavior is undefined unless `message` points at least `length` bytes of initialized memory or `length` is zero. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslh/SpookyHashAlgorithmImp/hash128.adoc[`hash128`] | Hash the specified `length` bytes of `message` using `hash1` and `hash2` as seeds. Load the higher order bits of the resulting 128‐bit hash value into `hash1` and the lower order bits in `hash2`. The behavior is undefined unless `message` points at least `length` bytes of initialized memory or `length` is zero, and both `hash1` and `hash2` point to at least 8 bytes of initialized, modifiable, memory. | xref:BloombergLP/bslh/SpookyHashAlgorithmImp/hash32.adoc[`hash32`] | Hash the specified `length` bytes of `message` using `seed` as a seed. Return the resulting 32‐bit hash. The behavior is undefined unless `message` points at least `length` bytes of initialized memory or `length` is zero. | xref:BloombergLP/bslh/SpookyHashAlgorithmImp/hash64.adoc[`hash64`] | Hash the specified `length` bytes of `message` using `seed` as a seed. Return the resulting 64‐bit hash. The behavior is undefined unless `message` points at least `length` bytes of initialized memory or `length` is zero. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#