{"id":22185916,"url":"https://github.com/n-r-k/chibihash","last_synced_at":"2025-04-06T14:11:08.473Z","repository":{"id":263212636,"uuid":"889536317","full_name":"N-R-K/ChibiHash","owner":"N-R-K","description":"Small, Fast, Portable 64-bit hash function","archived":false,"fork":false,"pushed_at":"2024-11-29T20:43:58.000Z","size":15,"stargazers_count":115,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T12:09:10.153Z","etag":null,"topics":["64-bit","c","hash","hash-function","hash-functions","smhasher"],"latest_commit_sha":null,"homepage":"https://nrk.neocities.org/articles/chibihash","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/N-R-K.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-16T15:23:56.000Z","updated_at":"2025-02-20T09:33:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"bc3dd5f5-6aa2-4b58-ab63-a55cda1b2f50","html_url":"https://github.com/N-R-K/ChibiHash","commit_stats":null,"previous_names":["n-r-k/chibihash"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N-R-K%2FChibiHash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N-R-K%2FChibiHash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N-R-K%2FChibiHash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/N-R-K%2FChibiHash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/N-R-K","download_url":"https://codeload.github.com/N-R-K/ChibiHash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247492513,"owners_count":20947544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["64-bit","c","hash","hash-function","hash-functions","smhasher"],"created_at":"2024-12-02T10:18:20.090Z","updated_at":"2025-04-06T14:11:08.441Z","avatar_url":"https://github.com/N-R-K.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChibiHash: Small, Fast 64 bit hash function\n\nI started writing this because all the 64 bit hash functions I came across were\neither too slow (FNV-1a, one byte at a time processing), or too large spanning\nhundreds of lines of code, or non-portable due to using hardware specific\ninstructions.\nBeing small and portable, the goal is to be able to use ChibiHash as a good\n\"default\" for non-cryptographic 64-bit hashing needs.\n\nSome key features:\n\n* Small: ~65 loc in C\n* Fast: See benchmark table below\n* Portable: Doesn't use hardware specific instructions (e.g SSE)\n* Good Quality: Passes [smhasher][] and [smhasher3][], so should be good quality (I think)\n* Unencumbered: Released into the public domain\n* Free of undefined behavior and gives same result regardless of host system's endianness.\n* Non-cryptographic\n\nHere's some benchmark (made via smhasher3) against other similar themed hash functions:\n\n| Name               |    Large input (GiB/sec)    |  Small input (Cycles/Hash) |\n| :---               | :-------------------------: | :------------------------: |\n| chibihash64                       |  **24.20**   |   34   |\n| xxhash64                          |    15.10     |   50   |\n| city64                            |    18.30     |   47   |\n| spooky64                          |    16.68     |   70   |\n| rapidhash.protected \u003csup\u003e1\u003c/sup\u003e  |    21.50     | **32** |\n| polymur-hash \u003csup\u003e1, 2\u003c/sup\u003e      |    13.82     |   43   |\n\n1. Requires compiler/cpu support for retrieving the full 128 bit result of a\n   64x64 bit multiply.\n2. Universal, but has a complicated seeding step.\n\n[smhasher]: https://github.com/aappleby/smhasher\n[smhasher3]: https://gitlab.com/fwojcik/smhasher3\n\n## When NOT to use\n\nThe introduction should make it clear on why you'd want to use this.\nHere are some reasons to avoid using this:\n\n* For cryptographic purposes.\n* For protecting against [collision attacks](https://en.wikipedia.org/wiki/Collision_attack) (SipHash is the recommended one for this purpose).\n* When you need very strong probability against collisions: ChibiHash does very\n  minimal amount of mixing compared to other hashes (e.g xxhash64). And so\n  chances of collision should in theory be higher.\n\n## Unofficial ports\n\nA list of unofficial ports to other languages is [maintained here](https://github.com/N-R-K/ChibiHash/issues/4).\n\n## Changelog\n\n### v2\n\n- Faster performance on short string (42 cycles/hash vs 34 cycles/hash).\n  The tail end handling has been reworked entirely with some inspiration from\n  wyhash's short input reading.\n- Better seeding. v1 seed only affected 64 bits of the initial state.\n  v2 seed affects the full 256 bits. This allows it to pass smhasher3's\n  SeedBlockLen and SeedBlockOffset tests.\n- Slightly better mixing in bulk handling.\n- Passes all 252 tests in smhasher3 (commit 34093a3), v1 failed 3.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn-r-k%2Fchibihash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn-r-k%2Fchibihash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn-r-k%2Fchibihash/lists"}