mruby-bigint (mrb_bint_hash): need to get hash from all digits

This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-07-27 18:04:43 +09:00
parent 203a89a3f2
commit 081cd0627f
+1 -1
View File
@@ -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);
}