{"id":33941757,"url":"https://github.com/hack-ink/array-bytes","last_synced_at":"2026-03-11T04:31:14.735Z","repository":{"id":46558741,"uuid":"324742716","full_name":"hack-ink/array-bytes","owner":"hack-ink","description":"A collection of Array/Bytes/Hex utilities with full No-STD compatibility.","archived":false,"fork":false,"pushed_at":"2025-12-08T01:04:02.000Z","size":398,"stargazers_count":20,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-12-14T05:28:54.646Z","etag":null,"topics":["array","bytes","hex","no-std","rust","serde"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/array-bytes","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/hack-ink.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE-APACHE2","code_of_conduct":null,"threat_model":null,"audit":"audit-report.md","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":"2020-12-27T11:03:36.000Z","updated_at":"2025-12-08T01:04:05.000Z","dependencies_parsed_at":"2023-01-31T02:30:27.884Z","dependency_job_id":"7e3739e6-091e-4fd8-9214-f90148f5a0d3","html_url":"https://github.com/hack-ink/array-bytes","commit_stats":{"total_commits":101,"total_committers":5,"mean_commits":20.2,"dds":0.6138613861386139,"last_synced_commit":"077718b01778ece8ddf40a43aee72714a448aebe"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/hack-ink/array-bytes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hack-ink%2Farray-bytes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hack-ink%2Farray-bytes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hack-ink%2Farray-bytes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hack-ink%2Farray-bytes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hack-ink","download_url":"https://codeload.github.com/hack-ink/array-bytes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hack-ink%2Farray-bytes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30370797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"online","status_checked_at":"2026-03-11T02:00:07.027Z","response_time":84,"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":["array","bytes","hex","no-std","rust","serde"],"created_at":"2025-12-12T16:51:31.819Z","updated_at":"2026-03-11T04:31:14.712Z","avatar_url":"https://github.com/hack-ink.png","language":"Rust","readme":"\u003cdiv align=\"center\"\u003e\n\n# array-bytes\n\n### A collection of Array/Bytes/Hex utilities with full No-STD compatibility\n\n[![License GPLv3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![License MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Checks](https://github.com/hack-ink/array-bytes/actions/workflows/checks.yml/badge.svg?branch=main)](https://github.com/hack-ink/array-bytes/actions/workflows/checks.yml)\n[![Docs](https://img.shields.io/docsrs/array-bytes)](https://docs.rs/array-bytes)\n[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/hack-ink/array-bytes)](https://github.com/hack-ink/array-bytes/tags)\n[![GitHub code lines](https://tokei.rs/b1/github/hack-ink/array-bytes)](https://github.com/hack-ink/array-bytes)\n[![GitHub last commit](https://img.shields.io/github/last-commit/hack-ink/array-bytes?color=red\u0026style=plastic)](https://github.com/hack-ink/array-bytes)\n\u003c/div\u003e\n\n## Usage\n\nHere are a few quick examples of the most commonly used operations: hexifying and dehexifying.\n\nHowever, this crate also offers many other utilities for Array/Bytes/Hex, each with comprehensive documentation and examples. Check them out on [docs.rs](https://docs.rs/array-bytes)!\n\n```rs\nuse array_bytes::{Dehexify, Error, Hexify};\nuse smallvec::SmallVec;\n\n// Hexify.\n// Unsigned.\nassert_eq!(52_u8.hexify(), \"34\");\nassert_eq!(520_u16.hexify_upper(), \"208\");\nassert_eq!(5_201_314_u32.hexify_prefixed(), \"0x4f5da2\");\nassert_eq!(5_201_314_u64.hexify_prefixed_upper(), \"0x4F5DA2\");\nassert_eq!(5_201_314_u128.hexify(), \"4f5da2\");\nassert_eq!(5_201_314_usize.hexify_upper(), \"4F5DA2\");\n// `[u8; N]`.\nassert_eq!(*b\"Love Jane Forever\".hexify(), String::from(\"4c6f7665204a616e6520466f7265766572\"));\n// `\u0026[u8; N]`.\nassert_eq!(\n\tb\"Love Jane Forever\".hexify_upper(),\n\tString::from(\"4C6F7665204A616E6520466F7265766572\")\n);\n// `\u0026[u8]`.\nassert_eq!(\n\tb\"Love Jane Forever\".as_slice().hexify_prefixed(),\n\tString::from(\"0x4c6f7665204a616e6520466f7265766572\")\n);\n// `Vec\u003cu8\u003e`.\nassert_eq!(\n\tb\"Love Jane Forever\".to_vec().hexify_prefixed_upper(),\n\tString::from(\"0x4C6F7665204A616E6520466F7265766572\")\n);\n// `\u0026Vec\u003cu8\u003e`.\nassert_eq!(\n\t(\u0026b\"Love Jane Forever\".to_vec()).hexify(),\n\tString::from(\"4c6f7665204a616e6520466f7265766572\")\n);\n// Dehexify.\n// Unsigned.\nassert_eq!(u8::dehexify(\"34\"), Ok(52));\nassert_eq!(u16::dehexify(\"208\"), Ok(520));\nassert_eq!(u32::dehexify(\"0x4f5da2\"), Ok(5_201_314));\nassert_eq!(u64::dehexify(\"0x4F5DA2\"), Ok(5_201_314));\nassert_eq!(u128::dehexify(\"4f5da2\"), Ok(5_201_314));\nassert_eq!(usize::dehexify(\"4F5DA2\"), Ok(5_201_314));\n// Array.\nassert_eq!(\n\t\u003c[u8; 17]\u003e::dehexify(\"0x4c6f7665204a616e6520466f7265766572\"),\n\tOk(*b\"Love Jane Forever\")\n);\n// `SmallVec`.\nassert_eq!(\n\tSmallVec::dehexify(\"0x4c6f7665204a616e6520466f7265766572\").unwrap().into_vec(),\n\tb\"Love Jane Forever\".to_vec()\n);\nassert_eq!(SmallVec::dehexify(\"我爱你\"), Err(Error::InvalidLength));\nassert_eq!(SmallVec::dehexify(\"0x我爱你\"), Err(Error::InvalidLength));\n// `Vec`.\nassert_eq!(\n\t\u003cVec\u003cu8\u003e\u003e::dehexify(\"0x4c6f7665204a616e6520466f7265766572\"),\n\tOk(b\"Love Jane Forever\".to_vec())\n);\nassert_eq!(\n\t\u003cVec\u003cu8\u003e\u003e::dehexify(\"我爱你 \"),\n\tErr(Error::InvalidCharacter { character: 'æ', index: 0 })\n);\nassert_eq!(\n\t\u003cVec\u003cu8\u003e\u003e::dehexify(\" 我爱你\"),\n\tErr(Error::InvalidCharacter { character: ' ', index: 0 })\n);\n```\n\n## Benchmark\n\nThe following benchmarks were run on a `Apple M4 Max 64GB - macOS 15.2 (24C101)`.\n\n\u003cdiv align=\"right\"\u003e\u003csub\u003eFri, Jan 3rd, 2025\u003c/sub\u003e\u003c/div\u003e\n\n```rs\n// Hexify.\narray_bytes::Hexify::hexify      time: [10.978 µs 10.997 µs 11.021 µs]\nconst_hex::encode                time: [941.68 ns 946.55 ns 951.44 ns]\nfaster_hex::hex_string           time: [11.478 µs 11.498 µs 11.519 µs]\nfaster_hex::hex_encode_fallback  time: [11.546 µs 11.563 µs 11.580 µs]\nhex::encode                      time: [85.347 µs 85.524 µs 85.751 µs]\nrustc_hex::to_hex                time: [46.267 µs 47.009 µs 47.759 µs]\n// Dehexify.\narray_bytes::Dehexify::dehexify  time: [19.143 µs 19.156 µs 19.173 µs]\narray_bytes::dehexify_slice_mut  time: [20.245 µs 20.274 µs 20.307 µs]\nconst_hex::decode                time: [13.861 µs 14.276 µs 14.975 µs]\nfaster_hex::hex_decode           time: [28.499 µs 28.545 µs 28.593 µs]\nfaster_hex::hex_decode_unchecked time: [11.775 µs 11.799 µs 11.828 µs]\nfaster_hex::hex_decode_fallback  time: [11.818 µs 11.840 µs 11.862 µs]\nhex::decode                      time: [90.870 µs 91.481 µs 92.126 µs]\nhex::decode_to_slice             time: [32.272 µs 32.553 µs 32.927 µs]\nrustc_hex::from_hex              time: [106.68 µs 107.45 µs 108.31 µs]\n```\n\nTo run the benchmarks yourself:\n\n```sh\ngit clone https://github.com/hack-ink/array-bytes\ncd array-bytes\ncargo bench\n```\n\n\u003cdiv align=\"right\"\u003e\n\n## License\n\n\u003csup\u003eLicensed under either of \u003ca href=\"LICENSE-APACHE\"\u003eApache-2.0\u003c/a\u003e or \u003ca href=\"LICENSE-GPL3\"\u003eGPL-3.0\u003c/a\u003e at your option.\u003c/sup\u003e\n\u003c/div\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhack-ink%2Farray-bytes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhack-ink%2Farray-bytes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhack-ink%2Farray-bytes/lists"}