sincerely
Singaporean
If you have not done so, read this full tutorial on how to use SGEXTN to build an application.
(no source file, everything inside header)
class SGLHashAlgorithm;
part of SGEXTN module SG_Containers
Implementation of 32bit WyHash for hash tables
list of all including inherited members
preprocessor file inclusion directive: #include ‹SGLHashAlgorithm.h›
CMake target for BuildLah: SGEXTN::SG_Containers
see this link for more information about BuildLah
parent class: (none)
children classes: (none)
static int wyHash32(const SGLSpan‹const unsigned char›& span);
SGLHashAlgorithm implements 32bit WyHash for a SGLSpan of const unsigned char. WyHash is a high quality hashing algorithm for producing hash tables with minimal hash collision. SGLHashAlgorithm allows you to implement WyHash for your custom structs so that they can be used with SGLHash. This is a template based class with no separate source file.
SGLHashAlgorithm implements 32bit WyHash as a static function. The implementation is placed in the header file to allow easier access to the WyHash source code.
Returns a int corresponding to the WyHash output from span.
For convenience, the functions returns a int not a unsigned int. These are effectively the same.
Check the source code of any SGEXTN struct (SGXChar, SGXString, SGXColourRGBA, SGXColourHSLA, SGXIdentifier, SGXTimeStamp, SGXVector2) to see how to implement hash() using this function.
Due to padding, attempting to hash the entire memory of custom structs is undefined behaviour. Instead hash only the defined fields.
©2025 05524F.sg (Singapore)