8 releases

Uses old Rust 2015

0.4.0 Oct 23, 2018
0.3.1 Jan 11, 2016
0.3.0 Apr 8, 2015
0.2.3 Mar 5, 2015
0.1.1 Nov 22, 2014

#21 in Video

Download history 20608/week @ 2022-11-26 19479/week @ 2022-12-03 20821/week @ 2022-12-10 19288/week @ 2022-12-17 11599/week @ 2022-12-24 17648/week @ 2022-12-31 21440/week @ 2023-01-07 22927/week @ 2023-01-14 23470/week @ 2023-01-21 20719/week @ 2023-01-28 23396/week @ 2023-02-04 22307/week @ 2023-02-11 22510/week @ 2023-02-18 34721/week @ 2023-02-25 26804/week @ 2023-03-04 25189/week @ 2023-03-11

113,263 downloads per month
Used in 227 crates (82 directly)

MIT/Apache

11KB
197 lines

base32 Build Status

This library lets you encode and decode in either RFC4648 Base32 or in Crockford Base32.

Usage

// crockford base32
assert_eq!(encode(CrockfordBase32, [0xF8, 0x3E, 0x0F, 0x83, 0xE0]), Vec::from_slice("Z0Z0Z0Z0".to_ascii()));
assert_eq!(decode(CrockfordBase32, "Z0Z0Z0Z0".to_ascii()).unwrap(), vec![0xF8, 0x3E, 0x0F, 0x83, 0xE0]);

// rfc4648 base32
assert_eq!(encode(RFC4648Base32, [0xF8, 0x3E, 0x7F, 0x83, 0xE7]), Vec::from_slice("7A7H7A7H".to_ascii()));
assert_eq!(decode(RFC4648Base32, "7A7H7A7H".to_ascii()).unwrap(), vec![0xF8, 0x3E, 0x7F, 0x83, 0xE7]);

// rfc4648 base32 without padding characters (=)
assert_eq!(encode(UnpaddedRFC4648Base32, [0xF8, 0x3E, 0x7F, 0x83, 0xE7]), Vec::from_slice("7A7H7A7H".to_ascii()));
assert_eq!(decode(UnpaddedRFC4648Base32, "7A7H7A7H".to_ascii()).unwrap(), vec![0xF8, 0x3E, 0x7F, 0x83, 0xE7]);

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps