rapidhash
An extremely fast, high quality, platform-independent hashing algorithm.
4.5.1
28M downloads/mo
#1725 most downloaded on crates.io
hoxxep/rapidhash
What this package is like to depend on
Last release 1 months ago
03 Jul 2026
Release timing varies
gaps range from 1 weeks to 5 months
Nearly every release is documented
notes for 23 of 23 stable releases
Nothing withdrawn
no release was ever pulled
2 years old
23 releases · first in 2024
11 releases in the last 12 months
see the full history below
Release timeline
23 releases · Sep 2024 to Jul 2026Releases
latest 23-
4.5.103 Jul 2026Release notes
Open source →What's Changed
- Fix size tests for s390x architectures with 8-byte alignment for u128 by @hoxxep in #101
- Fix new thread seeding for std but no-atomic targets by @hoxxep in #102
Full Changelog: v4.5.0...v4.5.1
Release notes
Open source →Fixes
- Fixed an edge case where targets with std but no atomics could see the same seed repeatedly on
RandomStateon new threads. (https://github.com/hoxxep/rapidhash/pull/102) - Fixed struct size tests for Debian packaging. (https://github.com/hoxxep/rapidhash/issues/90)
-
4.5.003 Jul 2026Release notes
Open source →Deprecations
- The
randfeature has been deprecated in favor ofgetrandom_04andgetrandom_03. - The
rngfeature has been deprecated in favor of therapidrandcrate.
Additions
getrandom_04feature: opt-in seeding of the hasher seeds and secrets from OS/platform entropy via the getrandom crate, without requiringstdnorrandcrate. This replaces therandfeature and enables true HashDoS resistance on targets with no ambient entropy or ASLR:wasm32-wasip1/wasm32-wasip2: enabling the feature is sufficient; entropy comes from the WASI host.wasm32-unknown-unknown(browser/node): additionally requires getrandom'swasm_jsbackend, enabled by the top-level binary. Building without the backend is a compile error rather than a silent fallback to deterministic seeding.- Embedded/
no_stdtargets with a hardware RNG: register a getrandom custom backend. On targets without atomic pointer support (e.g.thumbv6m-none-eabi), eachRandomStatedraws a fresh random seed per instance, restoring minimal HashDoS resistance where there previously was none.
getrandom_03feature: the same as thegetrandom_04feature, but using getrandom v0.3 to preserve the rapidhash MSRV 1.71.
Fixes
RandomStateno longer produces duplicate seeds across threads whose stacks are recycled by the OS. Each thread's seed counter is now initialized from a global thread counter mixed with the process-wide random seed, instead of relying on the (frequently re-used) stack address alone.- Better randomness handling and documentation for wasm targets,
no_stdtargets, and targets without atomics.
What's Changed
- Overhaul RandomState and GlobalState entropy logic by @hoxxep in #98
- Deprecate RapidRng in favour of rapidrand by @hoxxep in #99
Full Changelog: v4.4.2...v4.5.0
Release notes
Open source →Deprecations
- The
randfeature has been deprecated in favor ofgetrandom_04andgetrandom_03. - The
rngfeature has been deprecated in favor of therapidrandcrate.
Additions
getrandom_04feature: opt-in seeding of the hasher seeds and secrets from OS/platform entropy via the getrandom crate, without requiringstdnorrandcrate. This replaces therandfeature and enables true HashDoS resistance on targets with no ambient entropy or ASLR:wasm32-wasip1/wasm32-wasip2: enabling the feature is sufficient; entropy comes from the WASI host.wasm32-unknown-unknown(browser/node): additionally requires getrandom'swasm_jsbackend, enabled by the top-level binary. Building without the backend is a compile error rather than a silent fallback to deterministic seeding.- Embedded/
no_stdtargets with a hardware RNG: register a getrandom custom backend. On targets without atomic pointer support (e.g.thumbv6m-none-eabi), eachRandomStatedraws a fresh random seed per instance, restoring minimal HashDoS resistance where there previously was none.
getrandom_03feature: the same as thegetrandom_04feature, but using getrandom v0.3 to preserve the rapidhash MSRV 1.71.
Fixes
RandomStateno longer produces duplicate seeds across threads whose stacks are recycled by the OS. Each thread's seed counter is now initialized from a global thread counter mixed with the process-wide random seed, instead of relying on the (frequently re-used) stack address alone.- Better randomness handling and documentation for wasm targets,
no_stdtargets, and targets without atomics.
- The
-
4.4.227 Jun 2026Release notes
Open source →What's Changed
- Add 32-bit tests and test fixes by @hoxxep in #94
- Update readme to include used by note by @hoxxep in #95
- Fix documentation errors, link seed-independent collision article by @hoxxep in #96
Full Changelog: v4.4.1...v4.4.2
Release notes
Open source →Fixes
- Fixed documentation errors across the codebase.
- Fixed unit tests on 32-bit platforms. No library or CLI code changes were required.
-
4.4.120 Feb 2026Release notes
Open source →Performance
- Marked simple
RapidSecretsconstructors as#[inline(always)]. - Mark
get_secretsas#[inline(always)]inseeding.rs.
- Marked simple
-
4.4.016 Feb 2026Release notes
Open source →Additions
- Added
v3::RapidStreamHasherV3, an incremental streaming hasher with a write/finish API that mirrorsstd::hash::Hasher. It deliberately does not implementHasherdirectly, ensuring hash output remains stable and portable across platforms and compiler versions. Multiple calls towritewill produce the same hash as a single call torapidhash_v3with the concatenated input.
Performance
rapidhash_v3_filenow usesRapidStreamHasherV3internally, replacing the oldChunkedStreamReaderand significantly improving throughput by avoiding redundant buffer copies for large chunks.
What's Changed
Full Changelog: v4.3.0...v4.4.0
Release notes
Open source →Additions
- Added
v3::RapidStreamHasherV3, an incremental streaming hasher with awrite/finishAPI that mirrorsstd::hash::Hasher. It deliberately does not implementHasherdirectly, ensuring hash output remains stable and portable across platforms and compiler versions. Multiple calls towritewill produce the same hash as a single call torapidhash_v3with the concatenated input.
Performance
rapidhash_v3_filenow usesRapidStreamHasherV3internally, replacing the oldChunkedStreamReaderand significantly improving throughput by avoiding redundant buffer copies for large chunks.
- Added
-
4.3.008 Feb 2026Release notes
Open source →What's Changed
- Derive Debug for RandomState by @anp in #78
- Implement a consistent Debug on all inner::state::*_state.rs types by @hoxxep in #79
Full Changelog: v4.2.2...v4.3.0
Release notes
Open source →Additions
- Implemented
DebugonRandomState,GlobalState, andSeedableState. (@anp in #78 and @hoxxep in #79)
-
4.2.205 Feb 2026Release notes
Open source →Fixes
- Include LICENSE files in the published crate. (@anp in https://github.com/hoxxep/rapidhash/pull/77)
-
4.2.111 Jan 2026Release notes
Open source →Fixes
- Update
rapidhash_v3_filedocs for clarity and correctness.
Pull Request
- Update wasmtime requirement from 39.0.1 to 40.0.0 by @dependabot[bot] in #71
- Update rapidhash_v3_file docs for clarity and correctness. by @hoxxep in #72
Full Changelog: v4.2.0...v4.2.1
Release notes
Open source →Fixes
- Updated
v3::rapidhash_v3_filedocumentation to better describe the streaming interface.
- Update
-
4.2.020 Dec 2025Release notes
Open source →Additions
- Added
GlobalStatewhich initializes aRapidHasherwith a global seed and secrets that are randomized once on application start.
Pull Requests
- Bump actions/checkout from 5 to 6 by @dependabot[bot] in #60
- Update wasmtime requirement from 38.0.1 to 39.0.1 by @dependabot[bot] in #61
- Update criterion requirement from 0.7.0 to 0.8.1 by @dependabot[bot] in #63
- Implement GlobalState by @hoxxep in #64
- Improve documentation clarity by @hoxxep in #67
- chore: Replace assert_cmd cargo_bin usage by @hoxxep in #68
- Add benchmarks for GlobalState by @hoxxep in #69
- Prepare 4.2.0 release by @hoxxep in #70
Full Changelog: v4.1.1...v4.2.0
Release notes
Open source →Additions
- Added
GlobalStatewhich initializes aRapidHasherwith a global seed and secrets that are randomized once on application start.
- Added
-
4.1.121 Oct 2025Release notes
Open source →Fixes
- Fixed docsrs build flags, replacing
doc_auto_cfgwithdoc_cfg. (https://github.com/hoxxep/rapidhash/pull/55) - Fixed broken docsrs links. (https://github.com/hoxxep/rapidhash/pull/57)
- Fixed docsrs build flags, replacing
-
4.1.012 Sep 2025Release notes
Open source →Additions
- Added
SeedableState::newandSeedableState::customto create hasher builders with user-defined seeds and secrets.
Deprecations
SeedableState::with_seedhas been deprecated in favour ofSeedableState::customfor better naming and improved warnings in the documentation.
- Added
-
4.0.025 Aug 2025Release notes
Open source →https://github.com/hoxxep/rapidhash/pull/43
Breaking changes
rapidhash::v3micro/nano output change: input lengths 5-7 were mismatching the intended C++ V3 output. The C++ rapidhash V3 has been yanked and re-released as V3 to fix the bug, and this rust implementation will follow. This changes the hash outputs forrapidhash_v3_micro_inlineandrapidhash_v3_nano_inlinefor inputs of size 5, 6, and 7 bytes.RapidBuildHasherrenamed and refactored toSeedableState.RapidHasher<'s>new lifetime parameter added to support user-defined secrets viaSeedableState.RapidHashMapandRapidHashSetmoved to crate top level for convenience. The top level uses thefast::variants, and thequality::andinner::hashmaps have been removed. They can still be built manually usinginner::RandomStateif required. Thefast::collection variants have been deprecated to be removed in a future major release.
Additions
nightlyfeature which improves str hashing performance by omitting the0xFFsuffix write and adds likely/unlikely hints.SeedableState: a hasher builder which can be seeded with fixed or user-defined secrets. This replacesRapidBuildHasher, but still defaults to random seeds. It is slightly slower thanRandomState.
Performance improvements
- Bounds check elision: Improved
RapidHasherby eliding extra bounds checks in some cases by usingassert_unchecked. - Likely/unlikely hints: Added stable likely/unlikely hints in various places to ensure small inputs are favoured.
MSRV
- MSRV reduced to 1.71.0 from 1.77.0 by removing const usage of
first_chunk.
-
3.1.009 Aug 2025Release notes
Open source →Performance improvements
- Improved
RapidHashersmall string hashing performance by 1.5-15% depending on the benchmark, by reducing the small string hashing code size and allowing the compiler to inline more. Performance was also improved on big-endian platforms by reading native-endian bytes. The portable hashers (rapidhash::v3etc. modules) are unaffected by this change. #37
Fixes
- Improved
-
3.0.004 Aug 2025Release notes
Open source →Big performance improvements, and potentially rust's fastest general-purpose hasher!
Breaking changes
- Replaced
FNVwith aSPONGEconfiguration withRapidHasherto improve integer and tuple hashing performance. RandomStateremoved thewith_seedandwith_seed_and_static_secretsmethods to reduce the struct size. Please raise a GitHub issue if you need aSeededState-style hash builder for the in-memoryRapidHasher.- Added a
RapidSecretstype for all versions to generate seeds and secrets for HashDoS-resistant hashing. This makes generating unique seeds/secrets easier for persistent hashing use cases.rapidhash::v*portable hashing functions now all take a&RapidSecretsargument as a seed.- For full compatibility with the old integer seeds, instantiate
RapidSecrets::seed_cpp(u64)with your integer seed which will continue to use the default secrets. - For minimal DoS resistance, use
RapidSecrets::seed(u64)to generate a new seed and secrets.
RapidHasherremoved the oldwrite_constandfinish_constmethods as they were unlikely to be used and may cause confusion.rapidhash_v*_innermethods have a newAVALANCHEconst argument to control whether they should avalanche the output. Setting this totruewill match the default hash output and C++ implementation for the highest quality hashing. Turning off avalanching will reduce the hash quality, but improve performance, especially for small inputs.- Fixed the
rapidhash::v1V1_BUGargument to actually match the originalv1.x.xcrate behaviour, which changes the hash output. The if statement was fundamentally wrong in thev2.x.xcrate and failing to hash some bytes, apologies. This now has a proper test to prevent future regressions.
Additions
rapidhash::rng::rapidrng_fast_non_portable: a slightly faster, lower-quality RNG that also has optimisations for u32 platforms without wide-arithmetic support. Excellent for generating fixtures in our WASM benchmarks.
Deprecations
- The V1 and V2
rapidhash_filemethods have been deprecated, with a note to userapidhash::v3instead. This is because they aren't streaming-compatible hashing algorithms which may be misleading if someone has not read the documentation in detail. They will continue to be included for the foreseeable future as they provide the CLI functionality.
Performance improvements
RapidHashersignificantly improved performance hashing integers, tuples, and integer types using the newSPONGEconfiguration in both fast and quality modes.RapidHashernow uses a non-portable mixing function for an improvement on platforms with slow wide arithmetic, such as wasm32.rapidhash::v3has a healthy performance improvement for mid-size input lengths by skipping the 112+ length setup/teardown.
- Replaced
-
2.0.223 Jul 2025 -
2.0.123 Jul 2025 -
2.0.023 Jul 2025Release notes
Open source →Rapidhash algorithm changes have pushed us towards a refactor of this crate. Compatibility with rapidhash V2.0, V2.1, V2.2, and V3 are now all supported under
rapidhash::v3andrapidhash::v2modules. These exposerapidhash_v3and similar methods to avoid version confusion. Each version produces different hash outputs.- Breaking:
RapidHasherin-memory hasher overhaul:RapidHasherdeviates from the main rapidhash algorithm to improve performance hashing rust objects while maintaining similar hash quality. Performance should be significantly improved over the v1 crate.RapidHashermay change the underlying hash between minor versions. The rustHashertrait is not to be used for portable hashing, and we will follow this mantra to allow easily improving hashing performance. Portable hashing should be done though therapidhash::v3::rapidhash_v3(bytes: &[u8])and equivalent functions.RapidHasher,RandomState,RapidHashMap, andRapidHashSetnow move behind the following three modules:rapidhash::fastwhen hashing speed is the priority. This sacrifices some hash quality for speed, uses FNV when hashing integer types, and skips the final avalanche mixing step.rapidhash::qualitywhen hash quality is the ultimate priority. This closely resembles the rapidhash algorithm and hash quality.rapidhash::innerwhen you want to configure the settings forAVALANCHE,FNV,COMPACT, andPROTECTEDmodes as necessary.
- Breaking:
rapidhashportable hashing function moved and renamed, with different hash output:- Fixed the rapidhash V1 algorithm for 48 and 144 length inputs, where it would previously mismatch with the C implementation.
- If you need the old broken rapidhash V1 hash output,
rapidhash::v1::rapidhash_v1_inlinecan accept a compile time argumentV1_BUG=true, which will reproduce the old hash output from the 1.x crate versions.
- If you need the old broken rapidhash V1 hash output,
- Moved and renamed
rapidhash::rapidhash()torapidhash::v1::rapidhash_v1()to allow us to include other rapidhash versions in the same naming convention.
- Fixed the rapidhash V1 algorithm for 48 and 144 length inputs, where it would previously mismatch with the C implementation.
- Breaking: Random number generation has been moved behind the
rngmodule, but otherwise works the same. - Breaking:
RapidRandomStatehas been renamed toRandomState, and moved intofast,quality, andinnermodules. - Breaking: Removed
rapid_mixandrapid_mumfrom the public API for cleanliness. These are now internal functions. - Breaking: Removed the
RapidInline*variants in favour of making the defaultRapidtypes inline by default. If this is a problem for your use case, please raise a GitHub issue, thanks! - Breaking: Removed the deprecated
RapidHashBuildertype, it has been replaced withRapidBuildHasherto match the rust naming convention. - New: Added support for rapidhash V2.0, V2.1, V2.2, and V3 algorithms.
- New: rapidhash CLI now supports streaming properly with the V3 algorithm.
- Fix: Full tests and verification against the C implementations for all versions.
- Perf: Extensive benchmarking and optimisation, see more: https://github.com/hoxxep/rapidhash/issues/20
- Breaking:
-
1.4.019 Feb 2025 -
1.3.030 Dec 2024 -
1.2.004 Dec 2024 -
1.1.002 Oct 2024Release notes
Open source →- Deprecated
RapidHashBuilder. - Added
RapidBuildHasherto replaceRapidHashBuilder.
- Deprecated
-
1.0.002 Oct 2024Release notes
Open source →Ownership kindly transferred by Justin Bradford to Liam Gray and this repository.
- Breaking: Removed the
hashfunction that only hashes onu128types. - Added
rapidhashandrapidhash_seededfunctions to hash byte streams. - Added
RapidHasherandRapidHasherInlinefor hashing via astd::hash::Hashercompatible interface. - Added
RapidHashMap,RapidInlineHashMap,RapidHashSet, andRapidInlineHashSethelper types. - Added
RapidHashBuilderandRapidInlineHashBuilderforstd::hash::BuildHasherimplementing types compatible withHashMapandHashSet. - Added
RapidRandomStatefor random seed initialization. - Added
RapidRng,rapidrng_fast, andrapidrng_timefor random number generation inspired by the wyhash crate but based onrapid_mix. - Added
std,rand,rng, andunsafefeatures. - Extensive benchmarking and optimisation.
- Breaking: Removed the
-
0.1.017 Sep 2024Release notes
Open source →Initial release by Justin Bradford supporting rapidhash on
u128inputs.- Added
hashfor rapidhashingu128types.
- Added