API HashHelpers - shmellyorc/Box GitHub Wiki
Namespace: Box.Helpers
Description: A static utility class providing a fast, non-cryptographic 32-bit FNV-1a hash function for UTF-8 strings, ideal for generating consistent identifiers and keys for assets, resources, and other engine data requiring quick hash computations.
This is a static class; there are no public constructors.
No public properties.
Method | Signature | Returns | Description |
---|---|---|---|
Hash32 | static uint Hash32(string data) |
uint |
Computes the 32-bit FNV-1a hash of the UTF-8 encoded input string, returning a unique identifier suitable for fast lookups and resource mapping. |
// Generate a hash ID for a texture filename
uint textureId = HashHelpers.Hash32("background.png");
// Use this ID to store or lookup the texture in an asset dictionary
Surface background = Assets.Instance.Get<Surface>(textureId.ToString());