API Reference › Hash › Hash.of64
method

Hash.of64

Hash.of64(s) -> long

The 64-bit counterpart of Hash.of: hashes a string to a long instead of a 32-bit int. Use it when you want far fewer collisions than 32 bits can give — large content-id spaces, asset registries, or network identifiers where two different strings sharing a hash would be a real risk. Currently it is Hash.fnv1a_64, FNV-1a over the bytes. Deterministic like every hash here: the same string always gives the same 64-bit value.

Parameters

sthe string to hash

Example

program Ids64 {
  entry {
    let grass: long = Hash.of64("grass_tile")
    let water: long = Hash.of64("water_tile")
    print(grass)
    print(water)
  }
}
← All symbols