{"id":13822659,"url":"https://github.com/eldruin/wyhash-rs","last_synced_at":"2025-04-06T00:08:38.450Z","repository":{"id":41435430,"uuid":"175177549","full_name":"eldruin/wyhash-rs","owner":"eldruin","description":"wyhash fast portable non-cryptographic hashing algorithm and random number generator in Rust","archived":false,"fork":false,"pushed_at":"2023-08-10T13:44:45.000Z","size":100,"stargazers_count":90,"open_issues_count":6,"forks_count":11,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-25T03:44:18.449Z","etag":null,"topics":["algorithm","embedded","hash","hashing","no-std","non-cryptographic","non-cryptographic-hash-functions","prng","random","random-number-generators","rng","rust","wyhash"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eldruin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-03-12T09:28:32.000Z","updated_at":"2024-04-02T06:40:24.000Z","dependencies_parsed_at":"2024-01-18T04:07:16.163Z","dependency_job_id":"24bbbda6-688d-48d4-8fc8-cfe5e4e047ba","html_url":"https://github.com/eldruin/wyhash-rs","commit_stats":{"total_commits":135,"total_committers":3,"mean_commits":45.0,"dds":"0.014814814814814836","last_synced_commit":"8707fbe33bcd8354819712a93a4457cc83c367c2"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fwyhash-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fwyhash-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fwyhash-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fwyhash-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eldruin","download_url":"https://codeload.github.com/eldruin/wyhash-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415967,"owners_count":20935387,"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":["algorithm","embedded","hash","hashing","no-std","non-cryptographic","non-cryptographic-hash-functions","prng","random","random-number-generators","rng","rust","wyhash"],"created_at":"2024-08-04T08:02:11.595Z","updated_at":"2025-04-06T00:08:38.425Z","avatar_url":"https://github.com/eldruin.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# wyhash fast portable non-cryptographic hashing algorithm\n\n[![crates.io](https://img.shields.io/crates/v/wyhash.svg)](https://crates.io/crates/wyhash)\n[![Docs](https://docs.rs/wyhash/badge.svg)](https://docs.rs/wyhash)\n[![Build Status](https://github.com/eldruin/wyhash-rs/workflows/Build/badge.svg)](https://github.com/eldruin/wyhash-rs/actions?query=workflow%3ABuild)\n[![Coverage Status](https://coveralls.io/repos/github/eldruin/wyhash-rs/badge.svg?branch=master)](https://coveralls.io/github/eldruin/wyhash-rs?branch=master)\n\nRust implementation of the [wyhash algorithm by Wang Yi][original].\n\nThe hashing algorithm passes SMHasher and the random number generator passes BigCrush and practrand.\nAs of now it is the fastest algorithm in the SMHasher benchmark (faster than t1ha and XXH3).\nSee [here][original].\n\nFurthermore, this algorithm is solid, simple, portable (does not need hardware support, can be\nused in `no_std` environments) and has no dependencies (except the traits from `rand_core`).\n\nThe generated hashes are equal (see tests) as of the version stated [here][original-version]\nalthough the speed varies ([PRs are welcome][issue-tracker]).\n\n## Crate features\n\nBy default this crate uses 128-bit integer multiplications.\nTo restrict that to 64 bits you can enable the feature `mum32bit`. This offers better\nperformance on 32-bit architectures.\nBeware that this feature produces different results.\n\n## Usage\n\nThis crate provides free functions as well as implementations of the `Hasher`, `Rng` and\n`SeedableRng` traits.\n\n```rust\nuse core::hash::Hasher;\nuse wyhash::{make_secret, WyHash};\n\nfn main() {\n    let secret = make_secret(3);\n    let mut hasher = WyHash::new(4, secret);\n    hasher.write(\u0026[0, 1, 2]);\n    assert_eq!(0x8301_42a2_4404_5ff4, hasher.finish());\n}\n```\n\nSee further examples of the hasher and RNG in the documentation.\n\n## Performance comparison\n\nA basic performance comparison benchmark against [`fnv`], [`twox-hash`], [`metrohash`]\nand the standard hash_map hash [`collections::hash_map::DefaultHasher`][hash-map-hash]\nis included in the sources and you can run it with nightly Rust:\n\n```\ncargo +nightly bench\n```\n\n[`fnv`]: https://crates.io/crates/fnv\n[`twox-hash`]: https://crates.io/crates/twox-hash\n[`metrohash`]: https://crates.io/crates/metrohash\n[hash-map-hash]: https://doc.rust-lang.org/std/collections/hash_map/struct.DefaultHasher.html\n\n## Support\n\nFor questions, issues, feature requests, and other changes, please file an\n[issue in the github project][issue-tracker].\n\n## Minimum Supported Rust Version (MSRV)\n\nThis crate is guaranteed to compile on stable Rust 1.36.0 and up. It *might*\ncompile with older versions but that may change in any new patch release.\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\n   http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contributing\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n\n[issue-tracker]: https://github.com/eldruin/wyhash-rs/issues\n[original]: https://github.com/wangyi-fudan/wyhash\n[original-version]: https://github.com/eldruin/wyhash-rs/blob/master/comparison/original/CMakeLists.txt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldruin%2Fwyhash-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldruin%2Fwyhash-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldruin%2Fwyhash-rs/lists"}