mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
hash raw bytes of bignums
This commit is contained in:
parent
dc524feabc
commit
31c2adf8bf
1 changed files with 1 additions and 1 deletions
|
@ -67,7 +67,7 @@ static sexp_uint_t hash_one (sexp ctx, sexp obj, sexp_uint_t bound, sexp_sint_t
|
||||||
/* if the field_base is 0, skip to the value */
|
/* if the field_base is 0, skip to the value */
|
||||||
if ((sexp)p == obj) p=(sexp*)p0;
|
if ((sexp)p == obj) p=(sexp*)p0;
|
||||||
/* hash uvector data (otherwise strings all hash to the same value) */
|
/* hash uvector data (otherwise strings all hash to the same value) */
|
||||||
if (sexp_bytesp(obj) || sexp_uvectorp(obj)) {
|
if (sexp_bytesp(obj) || sexp_uvectorp(obj) || sexp_bignump(obj)) {
|
||||||
p_right = ((char*)p + sexp_type_num_slots_of_object(t, obj)*sizeof(sexp));
|
p_right = ((char*)p + sexp_type_num_slots_of_object(t, obj)*sizeof(sexp));
|
||||||
right_size = ((char*)obj + sexp_type_size_of_object(t, obj)) - p_right;
|
right_size = ((char*)obj + sexp_type_size_of_object(t, obj)) - p_right;
|
||||||
for (i=0; i<right_size; i++) {acc *= FNV_PRIME; acc ^= p_right[i];}
|
for (i=0; i<right_size; i++) {acc *= FNV_PRIME; acc ^= p_right[i];}
|
||||||
|
|
Loading…
Add table
Reference in a new issue