hash()
public
Returns a hash code for this object.
See also Object#hash.
static VALUE
ossl_bn_hash(VALUE self)
{
BIGNUM *bn;
VALUE hash;
unsigned char *buf;
int len;
GetBN(self, bn);
len = BN_num_bytes(bn);
buf = xmalloc(len);
if (BN_bn2bin(bn, buf) != len) {
xfree(buf);
ossl_raise(eBNError, NULL);
}
hash = INT2FIX(rb_memhash(buf, len));
xfree(buf);
return hash;
}