Crates.io | base32768 |
lib.rs | base32768 |
version | 0.1.0 |
source | src |
created_at | 2017-06-12 04:07:04.262039 |
updated_at | 2017-06-12 04:07:04.262039 |
description | Encodes binary data to UTF-16 text |
homepage | https://github.com/Dreae/base32768-rs |
repository | https://github.com/Dreae/base32768-rs |
max_upload_size | |
id | 18648 |
size | 2,403,156 |
Base32768 is a binary encoding for encoding arbitrary binary data to UTF-16 text.
// Encoding
let data = [72u8, 101u8, 108u8, 108u8, 111u8];
let encoded = base32768::encode(&data).unwrap(); // "䩲腻㐿"
// Decoding
let mut decoded = Vec::<u8>::new();
base32768::decode(&encoded, &mut decoded).unwrap();
println!("{}", String::from_utf8(decoded).unwrap()); // Prints "Hello"
This module is a pretty vanilla port of the original JavaScript module to Rust.