Hash Functions

Introduction

A hash function in datastructures is a function H which maps a value X to a small integer (where a small integer is an integer in the range [-2^28..2^28-1] on a 32-bit system, and [-2^60..2^60-1] on a 64-bit system), under the requirement that if X=Y, then H(X)=H(Y).

A variety of hash functions is provided by datastructures, with different behaviours. A bad choice of hash function can lead to serious performance problems.

datastructures does not guarantee consistency of hash values across release or &GAP; sessions.
Hash Functions for Basic Types a small integer Hashes any values built inductively from built-in types, namely integers, booleans, permutations, transformations, partial permutations, and constructors for lists and records.

This function is variadic, treating more than one argument as equivalent to a list containing the arguments, that is HashBasic(x,y,z) = HashBasic([x,y,z]).
Hash Functions for Permutation Groups

datastructures provides two hash functions for permutation groups; is the faster one, with higher likelihood of collisions and is slower but provides a lower likelihood of collisions. a small integer is faster than , but will return the same value for groups with the same size, orbits and degree of transitivity. a small integer is slower than , but is extremely unlikely to return the same hash for two different groups.