mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-bigint (mrb_bint_hash): need to get hash from all digits
This commit is contained in:
@@ -1665,7 +1665,7 @@ mrb_value
|
||||
mrb_bint_hash(mrb_state *mrb, mrb_value x)
|
||||
{
|
||||
struct RBigint *b = RBIGINT(x);
|
||||
uint32_t hash = mrb_byte_hash((uint8_t*)b->mp.p, b->mp.sz);
|
||||
uint32_t hash = mrb_byte_hash((uint8_t*)b->mp.p, b->mp.sz*sizeof(mp_limb));
|
||||
hash = mrb_byte_hash_step((uint8_t*)&b->mp.sn, sizeof(b->mp.sn), hash);
|
||||
return mrb_int_value(mrb, hash);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user