o_Compute Hash From To
Compute the hash value from the object's data. The result should be an int. To keep the rehashing cost down for concatenated tuples, we use a non-commutative hash function. If the tuple has elements with hash values , we use the formula . This can be rewritten as ). The constant a is chosen as a primitive element of the group , specifically 1,664,525, as taken from Knuth, The Art of Computer Programming, Vol. 2, 2nd ed., page 102, row 26. See also pages 19, 20, theorems B and C. The period of this cycle is 230.
To append an (n+1)st element to a tuple, one can compute the new hash by adding to the previous hash. Similarly, concatenating two tuples of length x and y is a simple matter of multiplying the right tuple's hash by and adding it to the left tuple's hash.
The element hash values are exclusive-ored with preToggle before being used, to help prevent similar nested tuples from producing equal hashes.
Parameters
The object containing elements to hash.
The first index of elements to hash.
The last index of elements to hash.