{"id":31288964,"url":"https://github.com/Nicoshev/rapidhash","last_synced_at":"2025-09-24T13:03:20.937Z","repository":{"id":241158736,"uuid":"802274088","full_name":"Nicoshev/rapidhash","owner":"Nicoshev","description":"Very fast, high quality, platform-independent hashing algorithm.","archived":false,"fork":false,"pushed_at":"2025-08-30T15:10:40.000Z","size":9587,"stargazers_count":630,"open_issues_count":4,"forks_count":29,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-08-30T17:23:45.805Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"wangyi-fudan/wyhash","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nicoshev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-05-17T21:50:41.000Z","updated_at":"2025-08-30T15:10:43.000Z","dependencies_parsed_at":"2025-05-06T18:37:40.070Z","dependency_job_id":"e3b115bd-17e3-416b-ad8b-79b81794a604","html_url":"https://github.com/Nicoshev/rapidhash","commit_stats":null,"previous_names":["nicoshev/rapidhash"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Nicoshev/rapidhash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nicoshev%2Frapidhash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nicoshev%2Frapidhash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nicoshev%2Frapidhash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nicoshev%2Frapidhash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nicoshev","download_url":"https://codeload.github.com/Nicoshev/rapidhash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nicoshev%2Frapidhash/sbom","scorecard":{"id":101391,"data":{"date":"2025-08-11","repo":{"name":"github.com/Nicoshev/rapidhash","commit":"bc4b4baa48a15ff52ff4725e1ccdcda62815221c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/22 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":10,"reason":"30 commit(s) and 8 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact rapidhash_v1.0 not signed: https://api.github.com/repos/Nicoshev/rapidhash/releases/168950310","Warn: release artifact rapidhash_v1.0 does not have provenance: https://api.github.com/repos/Nicoshev/rapidhash/releases/168950310"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":3,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'master'","Info: 'force pushes' disabled on branch 'master'","Info: 'branch protection settings apply to administrators' is required to merge on branch 'master'","Warn: could not determine whether codeowners review is allowed","Warn: no status checks found to merge onto branch 'master'","Warn: PRs are not required to make changes on branch 'master'; or we don't have data to detect it.If you think it might be the latter, make sure to run Scorecard with a PAT or use Repo Rules (that are always public) instead of Branch Protection settings"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-15T10:11:58.630Z","repository_id":241158736,"created_at":"2025-08-15T10:11:58.630Z","updated_at":"2025-08-15T10:11:58.630Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276754055,"owners_count":25698832,"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","status":"online","status_checked_at":"2025-09-24T02:00:09.776Z","response_time":97,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-09-24T13:01:53.696Z","updated_at":"2025-09-24T13:03:20.932Z","avatar_url":"https://github.com/Nicoshev.png","language":"C++","readme":"rapidhash - Very fast, high quality, platform-independent\n====\n\nFamily of three hash functions: rapidhash, rapidhashMicro and rapidhashNano\n\nUsed by [Chromium](https://chromium-review.googlesource.com/c/chromium/src/+/5667077), [Folly's F14](https://github.com/facebook/folly/blob/main/folly/container/HeterogeneousAccess.h#L130), [Ninja](https://github.com/ninja-build/ninja/blob/656412538b6fc102b809a61e0efce422e5a20534/src/build_log.cc#L61), [JuliaLang](https://github.com/JuliaLang/julia/blob/309b1b158f59485772d5f5fe0a762f20185cf799/base/hashing.jl#L281), [ziglang](https://github.com/ziglang/zig/pull/22085), [fb303](https://github.com/facebook/fb303/blob/6c0666c96b7112be2cb5608385063f1aed19c43f/fb303/ThreadCachedServiceData.h#L461), among others\n\n**Rapidhash**  \nGeneral purpose hash function, amazing performance across all sizes.  \nSurpasses [70GB/s](https://github.com/Nicoshev/rapidhash/tree/master?tab=readme-ov-file#outstanding-performance) on Apple's M4 cpus.  \nClang-18+ compiles it to ~185 instructions, both on x86-64 and aarch64.  \nThe fastest recommended hash function by [SMHasher](https://github.com/rurban/smhasher?tab=readme-ov-file#summary) and [SMHasher3](https://gitlab.com/fwojcik/smhasher3/-/blob/main/results/README.md#passing-hashes).\n\n**RapidhashMicro**  \nDesigned for HPC and server applications, where cache misses make a noticeable performance detriment.  \nClang-18+ compiles it to ~140 instructions without stack usage, both on x86-64 and aarch64.  \nFaster for sizes up to 512 bytes, just 15%-20% slower for inputs above 1kb.  \nProduces same output as Rapidhash for inputs up to 80 bytes.\n\n**RapidhashNano**  \nDesigned for Mobile and embedded applications, where keeping a small code size is a top priority.  \nClang-18+ compiles it to less than 100 instructions without stack usage, both on x86-64 and aarch64.  \nThe fastest for sizes up to 48 bytes, but may be considerably slower for larger inputs.  \nProduces same output as Rapidhash for inputs up to 48 bytes.\n\n**Streamable**  \nThe three functions can be computed without knowing the input length upfront.\n\n**Universal**  \nAll functions have been optimized for both AMD64 and AArch64 systems.  \nCompatible with gcc, clang, icx and MSVC.  \nThey do not use machine-specific vectorized or cryptographic instruction sets.\n\n**Excellent**  \nAll functions pass all tests in both [SMHasher](https://github.com/rurban/smhasher/blob/master/doc/rapidhash.txt) and [SMHasher3](https://gitlab.com/fwojcik/smhasher3/-/blob/main/results/raw/rapidhash.txt).  \n[Collision-based study](https://github.com/Nicoshev/rapidhash/tree/master?tab=readme-ov-file#collision-based-hash-quality-study) showed a collision probability close to ideal.  \nOutstanding collision ratio when tested with datasets of 16B and 67B keys:\n\n| Input Len | Nb Hashes | Expected | Nb Collisions |\n| ---  | ---   | ---   | --- |\n|   12 | 15 Gi |   7.0 |   6 |\n|   16 | 15 Gi |   7.0 |   7 |\n|   24 | 15 Gi |   7.0 |   7 |\n|   32 | 15 Gi |   7.0 |  10 |\n|   40 | 15 Gi |   7.0 |   4 |\n|   48 | 15 Gi |   7.0 |   7 |\n|   64 | 15 Gi |   7.0 |   6 |\n|   80 | 15 Gi |   7.0 |  11 |\n|   96 | 15 Gi |   7.0 |   6 |\n|  120 | 15 Gi |   7.0 |   8 |\n|  128 | 15 Gi |   7.0 |   6 |\n|   12 | 62 Gi | 120.1 | 122 |\n|   16 | 62 Gi | 120.1 |  97 |\n|   24 | 62 Gi | 120.1 | 125 |\n|   32 | 62 Gi | 120.1 | 131 |\n|   40 | 62 Gi | 120.1 | 117 |\n|   48 | 62 Gi | 120.1 | 146 |\n|   64 | 62 Gi | 120.1 | 162 |\n|   80 | 62 Gi | 120.1 | 165 |\n|   96 | 62 Gi | 120.1 | 180 |\n|  120 | 62 Gi | 120.1 | 168 |\n\nMore results can be found in the [collisions folder](https://github.com/Nicoshev/rapidhash/tree/master/collisions)\n\nOutstanding performance\n-------------------------\n\nAverage latency when hashing keys of 4, 8 and 16 bytes\n\n| Hash      | M1 Pro | M3 Pro | Neoverse V2 | AMD Turin | Ryzen 9700X |\n| ---       | ---    | ---    | ---         | ---       | ---         |\n| rapidhash | 1.79ns | 1.38ns | 2.05ns      | 2.31ns    | 1.46ns      |\n| xxh3      | 1.92ns | 1.50ns | 2.15ns      | 2.35ns    | 1.45ns      |\n\nPeak throughput when hashing files of 16Kb-2Mb\n\n| Hash      | M1 Pro | M3 Pro | M3 Ultra | M4     | Neoverse V2 | Ryzen 9700X |\n| ---       | ---    | ---    | ---      | ---    | ---         | ---         |\n| rapidhash | 47GB/s | 57GB/s | 61GB/s   | 71GB/s | 38GB/s      | 68GB/s      |\n| xxh3      | 37GB/s | 43GB/s | 47GB/s   | 49GB/s | 34GB/s      | 78GB/s      |\n\nLong-input measurements were taken compiling with the RAPIDHASH_UNROLLED macro.\n\nThe benchmarking program can be found in the [bench folder](https://github.com/Nicoshev/rapidhash/tree/master/bench)\n\nCollision-based hash quality study\n-------------------------\n\nA perfect hash function distributes its domain uniformly onto the image.  \nWhen the domain's cardinality is a multiple of the image's cardinality, each potential output has the same probability of being produced.  \nA function producing 64-bit hashes should have a $p=1/2^{64}$ of generating each output.\n\nIf we compute $n$ hashes, the expected amount of collisions should be the number of unique input pairs times the probability of producing a given hash.  \nThis should be $(n*(n-1))/2 * 1/2^{64}$, or simplified: $(n*(n-1))/2^{65}$.  \nIn the case of hashing $15*2^{30}$ (~16.1B) different keys, we should expect to see $7.03$ collisions.\n\nWe present an experiment in which we use rapidhash to hash $68$ datasets of $15*2^{30}$ (15Gi) keys each.  \nFor each dataset, the amount of collisions produced is recorded as measurement.  \nIdeally, the average among measurements should be $7.03$ and the results collection should be a binomial distribution.  \nWe obtained a mean value of $7.60$, just $8.11$% over $7.03$.  \nEach dataset individual result and the collisions test program can be found in the [collisions folder](https://github.com/Nicoshev/rapidhash/tree/master/collisions).  \nThe default seed $0$ was used in all experiments.\n\nPorts\n-------------------------\n[Java](https://github.com/dynatrace-oss/hash4j?tab=readme-ov-file#hash-algorithms) by hash4j  \n[Rust](https://github.com/hoxxep/rapidhash) by hoxxep    \n","funding_links":[],"categories":["Miscellaneous","C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNicoshev%2Frapidhash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNicoshev%2Frapidhash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNicoshev%2Frapidhash/lists"}