# std.hash.int: better handle odd bit sizes · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/ae6c24b49053853686699913297764361a6d6303)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: ae6c24b49053853686699913297764361a6d6303

Requested commit: ae6c24b49053853686699913297764361a6d6303

Commit: ae6c24b49053853686699913297764361a6d6303

Tree: 64ad8ec23158fd7cffe9e4a23dc87287b85ec6c6

Author: Francesco Alemanno

Committer: Andrew Kelley

## Message

```
std.hash.int: better handle odd bit sizes

Uses the non rational solution of a quadratic, I made it work up to 256
bits, added Mathematica code in case anyone wants to verify the magic
constant.

integers between sizes 3...15 were affected by fatal bias, it is best to
make them pass through the generic solution.

Thanks to RetroDev256 & Andrew feedback.

```

## Parents

- [d09fd249c090c68f6bba9731572e52f51afa7536](https://git.cafe/gitcafe/zig/commit/d09fd249c090c68f6bba9731572e52f51afa7536?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/ae6c24b49053853686699913297764361a6d6303?format=markdown)
