{"id":13822425,"url":"https://github.com/DoumanAsh/xxhash-rust","last_synced_at":"2025-05-16T17:30:47.252Z","repository":{"id":41975896,"uuid":"303405208","full_name":"DoumanAsh/xxhash-rust","owner":"DoumanAsh","description":"Rust implementation of xxhash","archived":false,"fork":false,"pushed_at":"2024-12-30T00:30:35.000Z","size":293,"stargazers_count":234,"open_issues_count":4,"forks_count":21,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-14T16:15:35.713Z","etag":null,"topics":["hash","rust","xxhash"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DoumanAsh.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}},"created_at":"2020-10-12T13:44:18.000Z","updated_at":"2025-05-14T13:58:00.000Z","dependencies_parsed_at":"2024-06-18T19:52:27.480Z","dependency_job_id":"90f1cd9e-0c2a-4bc9-a8fc-74e9e71a7191","html_url":"https://github.com/DoumanAsh/xxhash-rust","commit_stats":{"total_commits":70,"total_committers":7,"mean_commits":10.0,"dds":0.09999999999999998,"last_synced_commit":"0dc23dd9b8eaca11083cba00e02056b5f600a8fd"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoumanAsh%2Fxxhash-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoumanAsh%2Fxxhash-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoumanAsh%2Fxxhash-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoumanAsh%2Fxxhash-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DoumanAsh","download_url":"https://codeload.github.com/DoumanAsh/xxhash-rust/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254576379,"owners_count":22094357,"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":["hash","rust","xxhash"],"created_at":"2024-08-04T08:01:59.711Z","updated_at":"2025-05-16T17:30:47.245Z","avatar_url":"https://github.com/DoumanAsh.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# xxhash-rust\n\n[![Rust](https://github.com/DoumanAsh/xxhash-rust/actions/workflows/rust.yml/badge.svg)](https://github.com/DoumanAsh/xxhash-rust/actions/workflows/rust.yml)\n[![Crates.io](https://img.shields.io/crates/v/xxhash-rust.svg)](https://crates.io/crates/xxhash-rust)\n[![Documentation](https://docs.rs/xxhash-rust/badge.svg)](https://docs.rs/crate/xxhash-rust/)\n\nImplementation of [xxHash](https://github.com/Cyan4973/xxHash) in Rust\n\nEach algorithm is implemented via feature, allowing precise control over code size.\n\n## Example\n\n- Cargo.toml\n\n```toml\n[dependencies.xxhash-rust]\nversion = \"0.8.12\"\nfeatures = [\"xxh3\", \"const_xxh3\"]\n```\n\n- main.rs\n\n```rust\nuse xxhash_rust::const_xxh3::xxh3_64 as const_xxh3;\nuse xxhash_rust::xxh3::xxh3_64;\n\nconst TEST: u64 = const_xxh3(b\"TEST\");\n\nfn test_input(text: \u0026str) -\u003e bool {\n    match xxh3_64(text.as_bytes()) {\n        TEST =\u003e true,\n        _ =\u003e false\n    }\n}\n\nassert!(!test_input(\"tEST\"));\nassert!(test_input(\"TEST\"));\n```\n\n## Features:\n\nBy default all features are off.\n\n- `std` - Enables `std::io::Write` trait implementation\n- `xxh32` - Enables 32bit algorithm. Suitable for x86 targets\n- `const_xxh32` - `const fn` version of `xxh32` algorithm\n- `xxh64` - Enables 64 algorithm. Suitable for x86_64 targets\n- `const_xxh64` - `const fn` version of `xxh64` algorithm\n- `xxh3` - Enables `xxh3` family of algorithms, superior to `xxh32` and `xxh64` in terms of performance.\n- `const_xxh3` - `const fn` version of `xxh3` algorithm\n\n## HW acceleration\n\nSimilar to reference implementation, crate implements various SIMDs in `xxh3` depending on provided flags.\nAll checks are performed only at compile time, hence user is encouraged to enable these accelerations (for example via `-C target_cpu=native`)\n\nUsed SIMD acceleration:\n\n- SSE2 - widely available, can be safely enabled in 99% of cases. Enabled by default in `x86_64` targets.\n- AVX2;\n- Neon - Enabled by default on aarch64 targets (most likely)\n- Wasm SIMD128 - Has to be enabled via rust flag: `-Ctarget-feature=+simd128`\n\n## Streaming vs One-shot\n\nFor performance reasons one-shot version of algorithm does not re-use streaming version.\nUnless needed, user is advised to use one-shot version which tends to be more optimal.\n\n## `const fn` version\n\nWhile `const fn` provides compile time implementation, it does so at performance cost.\nHence you should only use it at _compile_ time.\n\nTo guarantee that something is computed at compile time make sure to initialize hash output\nas `const` or `static` variable, otherwise it is possible function is executed at runtime, which\nwould be worse than regular algorithm.\n\n`const fn` is implemented in best possible way while conforming to limitations of Rust `const\nfn`, but these limitations are quite strict making any high performance code impossible.\n\n## Version note\n\n- `0.8.*` corresponds to C's `0.8.*`\n\nIn order to  keep up with original implementation version I'm not planning to bump major/minor until C implementation does so.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDoumanAsh%2Fxxhash-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDoumanAsh%2Fxxhash-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDoumanAsh%2Fxxhash-rust/lists"}