hash()
public
Compute a hash based on the value of
big.
Show source
/*
* call-seq:
* big.hash => fixnum
*
* Compute a hash based on the value of _big_.
*/
static VALUE
rb_big_hash(x)
VALUE x;
{
long i, len, key;
BDIGIT *digits;
key = 0; digits = BDIGITS(x); len = RBIGNUM(x)->len;
for (i=0; i<len; i++) {
key ^= *digits++;
}
return LONG2FIX(key);
}