mirror of
https://github.com/janet-lang/janet
synced 2025-11-22 10:14:49 +00:00
Update hash mixing behavior - address #889
Try to have better behavior when mixing sub-hashes that are not uniform and randomly distributed. Premultiply by a large prime before mixing to "spread entropy" if it is concentrated in a certain subset of bits.
This commit is contained in:
@@ -56,6 +56,7 @@
|
||||
} while (0)
|
||||
|
||||
/* Utils */
|
||||
uint32_t janet_hash_mix(uint32_t input, uint32_t more);
|
||||
#define janet_maphash(cap, hash) ((uint32_t)(hash) & (cap - 1))
|
||||
int janet_valid_utf8(const uint8_t *str, int32_t len);
|
||||
int janet_is_symbol_char(uint8_t c);
|
||||
|
||||
Reference in New Issue
Block a user