#binary-file #encode #vice #printable #versa #utf16be #base16384-utf8

no-std base16384

Encode binary file to printable utf16be, and vice versa

1 unstable release

0.1.0 Jul 26, 2023

#2214 in Encoding

GPL-3.0 license

33KB
529 lines

base16384

Encode binary file to printable utf16be, and vice versa.

It is a Rust reimplementation of base16384.

Examples

use base16384::Base16384;

let data = b"12345678";
let encoded = Base16384::encode(data);
let text = String::from_utf16(&encoded).unwrap();
assert_eq!(text, "婌焳廔萷尀㴁");
use base16384::Base16384;

let data = "婌焳廔萷尀㴁".encode_utf16().collect::<Vec<_>>();
let decoded = Base16384::decode(&data).unwrap();
assert_eq!(decoded, b"12345678");

lib.rs:

Encode binary files to printable utf16.

See Base16384 and Base16384Utf8 for more details.

Examples

use base16384::Base16384;

let data = b"12345678";
let encoded = Base16384::encode(data);
let text = String::from_utf16(&encoded).unwrap();
assert_eq!(text, "婌焳廔萷尀㴁");
use base16384::Base16384;

let data = "婌焳廔萷尀㴁".encode_utf16().collect::<Vec<_>>();
let decoded = Base16384::decode(&data).unwrap();
assert_eq!(decoded, b"12345678");

No runtime deps