Crates.io | base16384 |
lib.rs | base16384 |
version | 0.1.0 |
source | src |
created_at | 2023-07-26 02:23:15.523881 |
updated_at | 2023-07-26 02:23:15.523881 |
description | Encode binary file to printable utf16be, and vice versa. |
homepage | |
repository | https://github.com/Wybxc/base16384-rs |
max_upload_size | |
id | 926168 |
size | 73,102 |
Encode binary file to printable utf16be, and vice versa.
It is a Rust reimplementation of base16384.
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");