{"id":20601150,"url":"https://github.com/dagenix/libhumancode","last_synced_at":"2025-10-24T19:23:54.273Z","repository":{"id":57634815,"uuid":"426456729","full_name":"DaGenix/libhumancode","owner":"DaGenix","description":null,"archived":false,"fork":false,"pushed_at":"2021-12-15T00:22:07.000Z","size":77,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T12:48:41.722Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/DaGenix.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.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}},"created_at":"2021-11-10T02:21:47.000Z","updated_at":"2022-08-19T10:32:42.000Z","dependencies_parsed_at":"2022-09-26T20:20:45.101Z","dependency_job_id":null,"html_url":"https://github.com/DaGenix/libhumancode","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaGenix%2Flibhumancode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaGenix%2Flibhumancode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaGenix%2Flibhumancode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaGenix%2Flibhumancode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DaGenix","download_url":"https://codeload.github.com/DaGenix/libhumancode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248989886,"owners_count":21194660,"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":[],"created_at":"2024-11-16T09:08:49.867Z","updated_at":"2025-10-24T19:23:54.167Z","avatar_url":"https://github.com/DaGenix.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libhumancode\n\n[![Crates.io](https://img.shields.io/crates/v/libhumancode.svg)](https://crates.io/crates/libhumancode)\n[![Documentation](https://docs.rs/libhumancode/badge.svg)](https://docs.rs/libhumancode)\n\nlibhumancode is a `no_std` compatible crate that provides a\nmechanism to encode up to 150 bits of binary data in a human\nfriendly format.\n\nz-base-32 encoding is used to encode all data - this allows for\nusing a minimal number of symbols to encode data (unlike regular\nbase-32, which requires padding characters depending on the number\nof bits to encode). Additionally, z-base-32 is designed to be human\nfriendly. The tradeoff is that the sender and receiver of a code must\nagree on the number of bits of data in each code.\n\nlibhumancode also uses a configurable number of error correction\nsymbols using a Reed Solomon GF(2^5) code. For each error correcting\nsymbol added, this means that we can detect at least 1 error in\na code. For every two symbols added, we can correct an error. Note\nthat these properties are not additive - with 5 error correcting\nsymbols, if we have an input with 2 errors, we will always correct\nit. If we have an input with 3 errors, we will always report it as\nincorrect. However, if we have an input with 4 errors, we might\naccidentally \"correct\" it to an invalid code. As such, its highly\nrecommended to confirm code corrections with the user.\n\n## Example\n\n```rust\nuse libhumancode::{decode_chunk, encode_chunk};\n\nfn main() {\n    const DATA: \u0026'static [u8] = \u0026[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];\n    const ECC_SYMBOLS: u8 = 5;\n    const BITS: u8 = 128;\n    const CORRECT_CODE: \u0026'static str = \"yyyo-ryar-ywdy-qnyj-befo-adeq-bhix-4os\";\n    const INVALID_CODE: \u0026'static str = \"!!yo-ryar-ywdy-qnyj-befo-adeq-bhix-4os\";\n\n    let encoded = encode_chunk(DATA, ECC_SYMBOLS, BITS).unwrap();\n    let encoded_pretty = encoded.pretty();\n\n    assert_eq!(encoded_pretty.as_str(), CORRECT_CODE);\n\n    let (decoded, corrected) = decode_chunk(INVALID_CODE, ECC_SYMBOLS, BITS).unwrap();\n\n    assert_eq!(decoded.as_bytes(), DATA);\n    assert_eq!(corrected.unwrap().pretty().as_str(), CORRECT_CODE);\n}\n```\n\n## No_std\n\nNo_std mode may be activated by disabling the \"std\" feature.\n\n## License\n\nThis project is licensed under either of\n\n* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or\n  \u003chttps://www.apache.org/licenses/LICENSE-2.0\u003e)\n* MIT license ([LICENSE-MIT](LICENSE-MIT) or\n  \u003chttps://opensource.org/licenses/MIT\u003e)\n\nat your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdagenix%2Flibhumancode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdagenix%2Flibhumancode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdagenix%2Flibhumancode/lists"}