hash

hash, function

def const pure hash(t: text): number

Returns a pseudo-injective hash value between 0 and $2^{24} - 1$.

Examples

table T = with
  [| as Word |]
  [| "The" |]
  [| "quick" |]
  [| "brown" |]

T.Hash = hash(T.Word)

show table "Hashes" with
  T.Word
  T.Hash

This produces the following table:

Word Hash
The 12761730
quick 6062464
brown 16447500

Remarks

hash is commonly used to shuffle data by sorting on the hash value.

User Contributed Notes
0 notes + add a note