{"id":18674066,"url":"https://github.com/nervosnetwork/faster-hex","last_synced_at":"2025-12-12T16:55:06.869Z","repository":{"id":47448853,"uuid":"155337704","full_name":"nervosnetwork/faster-hex","owner":"nervosnetwork","description":"fast hex","archived":false,"fork":false,"pushed_at":"2025-03-11T02:26:31.000Z","size":157,"stargazers_count":88,"open_issues_count":8,"forks_count":17,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-28T02:48:51.060Z","etag":null,"topics":["hex","rust","rust-lang","simd"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/faster-hex","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nervosnetwork.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-10-30T06:47:00.000Z","updated_at":"2025-03-23T07:07:05.000Z","dependencies_parsed_at":"2023-11-16T08:30:58.747Z","dependency_job_id":"133646ec-7712-4bc5-b82c-46b94fee4f49","html_url":"https://github.com/nervosnetwork/faster-hex","commit_stats":{"total_commits":64,"total_committers":10,"mean_commits":6.4,"dds":0.578125,"last_synced_commit":"f2c29387864c2512c577f6ca706f5c6183227be5"},"previous_names":["nervosfoundation/faster-hex"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Ffaster-hex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Ffaster-hex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Ffaster-hex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Ffaster-hex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nervosnetwork","download_url":"https://codeload.github.com/nervosnetwork/faster-hex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415967,"owners_count":20935388,"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":["hex","rust","rust-lang","simd"],"created_at":"2024-11-07T09:17:23.554Z","updated_at":"2025-12-12T16:55:01.800Z","avatar_url":"https://github.com/nervosnetwork.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# faster-hex\n\n[![License]](#license)\n[![crate-badge]](https://crates.io/crates/faster-hex)\n\n[crate-badge]: https://img.shields.io/crates/v/faster-hex.svg\n[license]: https://img.shields.io/badge/License-MIT-green.svg\n\nThis program implements hex encoding a slice into a predetermined\ndestination using various different instruction sets.\n\n## Benchmark\n\n### Running\nRuns benchmark\n```\ncargo bench\n```\n\n### Results\nMachine: MacBook Pro (Early 2015) (2.7 GHz Intel Core i5)\n\nRust: rustc 1.31.0 (abe02cefd 2018-12-04)\n\nCompare with [hex](https://crates.io/crates/hex):\n\n* Encoding ~10x over\n* Decoding ~10x over\n\nCompare with [rustc-hex](https://crates.io/crates/rustc-hex):\n\n* Encoding ~2.5x over\n* Decoding ~7x over\n\n## Examples\nEncode to hex\n\n```rust\nuse faster_hex::hex_string;\n\nlet result = hex_string(b\"Hello world!\");\nassert_eq!(result, \"48656c6c6f20776f726c6421\");\n```\nEncode to upper case hex\n```rust\nuse faster_hex::hex_string_upper;\n\nlet result = hex_string_upper(b\"Hello world!\");\nassert_eq!(result, \"48656C6C6F20776F726C6421\");\n```\n\nDecode\n```rust\nuse faster_hex::hex_decode;\n\nlet src = b\"48656c6c6f20776f726c6421\";\nlet mut dst = vec![0; src.len() / 2];\nhex_decode(src, \u0026mut dst).unwrap();\nassert_eq!(dst, b\"Hello world!\");\n```\nDecode with case check\n```rust\nuse faster_hex::{hex_decode_with_case, CheckCase};\n\nlet src = b\"48656c6c6f20776f726c6421\";\nlet mut dst = vec![0; src.len() / 2];\n\nassert!(hex_decode_with_case(src, \u0026mut dst, CheckCase::Lower).is_ok());\nassert_eq!(dst, b\"Hello world!\");\n\nassert!(hex_decode_with_case(src, \u0026mut dst, CheckCase::None).is_ok());\nassert_eq!(dst, b\"Hello world!\");\n\nassert!(hex_decode_with_case(src, \u0026mut dst, CheckCase::Upper).is_err());\n```\n\nSerde feature\n```rust\n\nuse serde::{Deserialize, Serialize};\n\n#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]\nstruct Simple {\n  #[serde(with = \"faster_hex\")]\n  foo: Vec\u003cu8\u003e,\n  #[serde(with = \"faster_hex::nopfx_lowercase\")]\n  bar: Vec\u003cu8\u003e,\n}\n```\n\n\n## Notice\n\nMajor version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.\n\nMINOR version when make incompatible API changes before 1.0.0.\n\n\n## License\n\nThis project is licensed under the [MIT license](LICENSE).\n\n### Third party software\n\nThis product includes copies and modifications of software developed by third parties:\n\n* [src/encode.rs](src/encode.rs) is based on\n  [stdsimd](https://github.com/rust-lang-nursery/stdsimd), licensed\n  under the MIT license or the Apache License (Version 2.0).\n* [src/decode.rs](src/decode.rs) avx2 decode is modified from [fast-hex](https://github.com/zbjornson/fast-hex)\n\nSee the source code files for more details.\n\nCopies of third party licenses can be found in [LICENSE-THIRD-PARTY](LICENSE-THIRD-PARTY).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnervosnetwork%2Ffaster-hex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnervosnetwork%2Ffaster-hex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnervosnetwork%2Ffaster-hex/lists"}