XLE
v0.02.0
|
Generate a hash value at compile time More...
#include <MemoryUtils.h>
Classes | |
struct | Calc |
Static Public Attributes | |
static const uint64 | Seed = 0xE49B0E3F5C27F17Eull |
static const uint64 | Value = Calc<S3, Calc<S2, Calc<S1, Calc<S0, Seed>::Value>::Value>::Value>::Value |
Generate a hash value at compile time
Generate a simple hash value at compile time, from a set of 4-character chars.
The hash algorithm is very simple, and unique. It will produce very different hash values compared to the Hash64 function. There may be some value to attempting to make it match the "Hash64" function. However, that would require a lot more work... The current implementation is more or less the simpliest possible implementation.
Usage:
Note that a better implementation would be possible with C++11... But currently we're still supporting Visual Studio 2010, which doesn't have an implementation of constexpr.