[#BloombergLP-bslh-SpookyHashAlgorithmImp]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslh.adoc[bslh]::SpookyHashAlgorithmImp
:relfileprefix: ../../
:mrdocs:

This class wraps an implementation of Bob Jenkin&apos;s &quot;SpookyHash&quot; in a BDE&hyphen;style component&period; For more information, see http&colon;&sol;&sol;burtleburtle&period;net&sol;bob&sol;hash&sol;spooky&period;html &period;

== Synopsis

Declared in `&lt;bslh&lowbar;spookyhashalgorithmimp&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class SpookyHashAlgorithmImp;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslh/SpookyHashAlgorithmImp/Uint16.adoc[`Uint16`] 
| 16&hyphen;bit unsigned integer type used by the implementation&period;
| xref:BloombergLP/bslh/SpookyHashAlgorithmImp/Uint32.adoc[`Uint32`] 
| 32&hyphen;bit unsigned integer type used by the implementation&period;
| xref:BloombergLP/bslh/SpookyHashAlgorithmImp/Uint64.adoc[`Uint64`] 
| 64&hyphen;bit unsigned integer type used by the implementation&period;
| xref:BloombergLP/bslh/SpookyHashAlgorithmImp/Uint8.adoc[`Uint8`] 
| 8&hyphen;bit unsigned integer type used by the implementation&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslh/SpookyHashAlgorithmImp/2constructor.adoc[`SpookyHashAlgorithmImp`]         [.small]#[constructor]#
| Create a `bslh&colon;&colon;SpookyHashAlgorithmImp`, initializing the internal state of the object using the specified `seed1` and `seed2` as seeds for the algorithm&period;
| xref:BloombergLP/bslh/SpookyHashAlgorithmImp/finalize.adoc[`finalize`] 
| Load the finalized hash into the specified `hash1` and `hash2`&period; `hash1` will contain the higher order bits of the hash and `hash2` will contain the lower order bits&period; The internal state of the algorithm will be modified, meaning that calling final multiple times will result in different hash values being returned&period; The returned hash will be the same as if `Hash128` had been called will all of the accumulated data in one block&period; The behavior is undefined unless both `hash1` and `hash2` point to 8 bytes of modifiable memory&period; Note that a value will be returned even if `update` has not been called&period;
| xref:BloombergLP/bslh/SpookyHashAlgorithmImp/update.adoc[`update`] 
| Accumulate the specified `length` bytes of `message` into the internal state of the algorithm&period; Accumulating bytes through `Update` will produce the same result as hashing them all at once through the `HashXX` static methods&period; The behavior is undefined unless `message` points at least `length` bytes of initialized memory or `length` is zero&period;
|===


== 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&period; Load the higher order bits of the resulting 128&hyphen;bit hash value into `hash1` and the lower order bits in `hash2`&period; 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&period;
| xref:BloombergLP/bslh/SpookyHashAlgorithmImp/hash32.adoc[`hash32`] 
| Hash the specified `length` bytes of `message` using `seed` as a seed&period; Return the resulting 32&hyphen;bit hash&period; The behavior is undefined unless `message` points at least `length` bytes of initialized memory or `length` is zero&period;
| xref:BloombergLP/bslh/SpookyHashAlgorithmImp/hash64.adoc[`hash64`] 
| Hash the specified `length` bytes of `message` using `seed` as a seed&period; Return the resulting 64&hyphen;bit hash&period; The behavior is undefined unless `message` points at least `length` bytes of initialized memory or `length` is zero&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
