5 unstable releases
0.3.1 | Sep 7, 2024 |
---|---|
0.3.0 | Aug 8, 2023 |
0.2.0 | Dec 1, 2021 |
0.1.1 | Sep 22, 2021 |
0.1.0 | Sep 22, 2021 |
#1521 in Encoding
225 downloads per month
32KB
652 lines
G60
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.
Example
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());
}
License
This project is licensed under MIT.