API HashHelpers - shmellyorc/Box GitHub Wiki

Hash Helpers

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.


Constructors

This is a static class; there are no public constructors.


Properties

No public properties.


Methods

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.

Examples

// 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());
⚠️ **GitHub.com Fallback** ⚠️