g60

Crates.iog60
lib.rsg60
version0.3.1
sourcesrc
created_at2021-09-22 18:37:10.83352
updated_at2024-09-07 09:09:49.734696
descriptionencodes and decodes G60 as bytes or utf8
homepage
repositoryhttps://github.com/juliotpaez/rust-g60
max_upload_size
id455050
size38,096
Julio Treviño Páez (juliotpaez)

documentation

https://docs.rs/g60

README

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.

Docs

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.

Commit count: 21

cargo fmt