M.V. Hutz 867a1d49df
All checks were successful
CI / Check PR Title (push) Has been skipped
CI / Makefile Lint (push) Successful in 1m4s
CI / Markdown Lint (push) Successful in 32s
CI / Go Lint (push) Successful in 1m15s
CI / Unit Tests (push) Successful in 38s
CI / Fuzz Tests (push) Successful in 1m34s
CI / Mutation Tests (push) Successful in 1m31s
feat: sentinel error ErrBadHash (#19)
## Description

Currently, the errors are not sentinel, and so are hard to test for. This PR makes sure hash collision errors are accounted for.

## Changes

- Add `ErrBadHash`. Happens when there are too many collisions for an item to be added.

### Design Decisions

- Chose to name `ErrBadHash` over `ErrCycle` because the feedbach that the user should be given is to evaluate their hash functions. Cycle collision is a bit esoteric.

## Checklist

- [x] Tests pass
- [x] Docs updated

Reviewed-on: #19
Co-authored-by: M.V. Hutz <git@maximhutz.me>
Co-committed-by: M.V. Hutz <git@maximhutz.me>
2026-04-14 00:38:11 +00:00
2026-03-17 01:22:42 +00:00
2026-03-17 01:22:42 +00:00
2026-03-17 01:22:42 +00:00
2026-03-20 01:59:54 +00:00
2026-03-20 01:59:54 +00:00
2026-03-17 01:22:42 +00:00
2026-03-17 00:59:15 +00:00
2026-04-14 00:38:11 +00:00

Go Cuckoo, by `mvhutz`. Go Cuckoo

A hash table that uses cuckoo hashing to achieve a worst-case O(1) lookup time. Read more about it in the package documentation.

Description
A hash table that uses cuckoo hashing to achieve a worst-case O(1) lookup time.
Readme AGPL-3.0 354 KiB
Languages
Go 93.9%
Makefile 6.1%