Crates.io | g60 |
lib.rs | g60 |
version | 0.3.1 |
source | src |
created_at | 2021-09-22 18:37:10.83352 |
updated_at | 2024-09-07 09:09:49.734696 |
description | encodes and decodes G60 as bytes or utf8 |
homepage | |
repository | https://github.com/juliotpaez/rust-g60 |
max_upload_size | |
id | 455050 |
size | 38,096 |
A G60 format (de)encoder for rust.
G60 is an encoding that uses 60 distinct ASCII characters, specifically all letters and digits except for capital I and O. G60 encodes 8 bytes to 11 characters, increasing the length in bytes by 37.5%, barely more than the 33⅓% for base64, and much less than the 60% for base-32.
G60 was developed by Galen Huntington. This is just a Rust implementation of his work. See the whole definition of the format in his repo.
use g60::{encode, decode};
fn main() {
let origin = b"Hello, world!";
let encoded = "Gt4CGFiHehzRzjCF16";
assert_eq!(g60::encode(origin), encoded);
assert_eq!(origin, g60::decode(&encoded).unwrap());
}
This project is licensed under MIT.