hash

Generated by tinox doc

Simple non-cryptographic hash functions: djb2-style string hashing, an integer avalanche hash, and a combine() helper for building composite hashes (e.g. hashCode() over multiple fields).

Hash code

import tinox.core.hash;

class Main
{
    fnc main() -> Int32
    {
        let h1: Int64 = Hash::hashString("alice@example.com");
        let h2: Int64 = Hash::hashInt(42);

        let combined: Int64 = Hash::combine(h1, h2);
        println("combined hash: " + combined.toString());

        return 0;
    }
}

class Hash

Methods

fn hashString(s: String) → Int64
fn hashInt(n: Int64) → Int64
fn combine(h1: Int64, h2: Int64) → Int64