{"id":16819596,"url":"https://github.com/slowli/const-decoder","last_synced_at":"2025-03-22T03:31:34.222Z","repository":{"id":39917396,"uuid":"358605101","full_name":"slowli/const-decoder","owner":"slowli","description":"Constant functions for converting hex- and base64-encoded strings into bytes","archived":false,"fork":false,"pushed_at":"2025-02-24T03:21:29.000Z","size":1164,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-01T12:25:28.264Z","etag":null,"topics":["base64","const-evaluation","encoding","hex"],"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/slowli.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-16T13:16:48.000Z","updated_at":"2025-01-21T14:49:51.000Z","dependencies_parsed_at":"2024-02-03T14:23:56.229Z","dependency_job_id":"7fec2fe2-bd29-493d-9364-123f4ba0e924","html_url":"https://github.com/slowli/const-decoder","commit_stats":{"total_commits":41,"total_committers":2,"mean_commits":20.5,"dds":0.09756097560975607,"last_synced_commit":"ba31f10a290883ea11e89dee32411268a4e6c88c"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slowli%2Fconst-decoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slowli%2Fconst-decoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slowli%2Fconst-decoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slowli%2Fconst-decoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slowli","download_url":"https://codeload.github.com/slowli/const-decoder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244180630,"owners_count":20411600,"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":["base64","const-evaluation","encoding","hex"],"created_at":"2024-10-13T10:53:59.376Z","updated_at":"2025-03-22T03:31:33.784Z","avatar_url":"https://github.com/slowli.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Constant Functions for Hex / Base64 Decoding\n\n[![Build Status](https://github.com/slowli/const-decoder/workflows/CI/badge.svg?branch=master)](https://github.com/slowli/const-decoder/actions)\n[![License: MIT OR Apache-2.0](https://img.shields.io/badge/License-MIT%2FApache--2.0-blue)](https://github.com/slowli/const-decoder#license)\n![rust 1.67+ required](https://img.shields.io/badge/rust-1.67+-blue.svg?label=Required%20Rust)\n\n**Documentation:** [![Docs.rs](https://img.shields.io/docsrs/const-decoder)](https://docs.rs/const-decoder/)\n[![crate docs (master)](https://img.shields.io/badge/master-yellow.svg?label=docs)](https://slowli.github.io/const-decoder/const_decoder/)\n\nConstant functions for converting hex- and base64-encoded strings into bytes in Rust.\nWorks on stable Rust and in no-std environments. Base-(2,4,8,16,32,64) encodings with\ncustom alphabets are supported as well.\n\n## Usage\n\nAdd this to your `Crate.toml`:\n\n```toml\n[dependencies]\nconst-decoder = \"0.4.0\"\n```\n\nExample of usage:\n\n```rust\nuse const_decoder::Decoder;\n// An Ed25519 secret key.\nconst SECRET_KEY: [u8; 64] = Decoder::Hex.decode(\n    b\"9e55d1e1aa1f455b8baad9fdf975503655f8b359d542fa7e4ce84106d625b352\\\n      06fac1f22240cffd637ead6647188429fafda9c9cb7eae43386ac17f61115075\",\n);\n// Alternatively, you can use `decode!` macro:\nconst PUBLIC_KEY: \u0026[u8] = \u0026const_decoder::decode!(\n    Decoder::Hex,\n    b\"06fac1f22240cffd637ead6647188429fafda9c9cb7eae43386ac17f61115075\",\n);\n```\n\n[Bech32] encoding:\n\n```rust\nuse const_decoder::{Decoder, Encoding};\nconst BECH32: Decoder = Decoder::custom(\"qpzry9x8gf2tvdw0s3jn54khce6mua7l\");\n// Sample address from the Bech32 spec excluding the `tb1q` prefix\n// and the checksum suffix.\nconst SAMPLE_ADDR: [u8; 32] =\n    BECH32.decode(b\"rp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q\");\n```\n\nSee more examples in the crate docs.\n\n## Alternatives\n\n[`hex-literal`] and [`binary_macros`] crates expose similar functionality\nas procedural macros. Because of this, macros cannot be used in no-std environments,\nwhile this approach can.\n\n## License\n\nLicensed under either of [Apache License, Version 2.0](LICENSE-APACHE)\nor [MIT license](LICENSE-MIT) at your option.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in `const-decoder` by you, as defined in the Apache-2.0 license,\nshall be dual licensed as above, without any additional terms or conditions.\n\n[Bech32]: https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki\n[`binary_macros`]: https://crates.io/crates/binary_macros\n[`hex-literal`]: https://crates.io/crates/hex_literal\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslowli%2Fconst-decoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslowli%2Fconst-decoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslowli%2Fconst-decoder/lists"}