Emoji256 is a binary-to-text encoding scheme for reading hashes and cryptographic keys. By translating text to pictographs, we can use our automatic biological storytelling machinery to grok or even memorize arbritrary byte sequences.
Each 8-bit value has a unique emoji representation. To translate values to emojis, emoji256 utilizes a pre-defined lookup table found in src/table.rs
. The lookup table is actively being tweaked to reduce biases and increase grok-ability. Emoji256 will not be a stable format until the table is frozen with v1.0.
This Rust crate encodes and decodes data into/from emoji256. It uses the same API as the popular Rust crate, hex.
Encoding a String
let encoded_string = emoji256::encode("Hello world!");
println!("{}", encoded_string); // Prints "🐙👽💉💉💌🍭💦💌💕💉👻🍰"
Decoding a String
let decoded_string = String::from_utf8(emoji256::decode("🐙👽💉💉💌🍭💦💌💕💉👻🍰").unwrap()).unwrap();
println!("{}", decoded_string); // Prints "Hello world!"
You can find the documentation here.
In order to use this crate, you have to add it under [dependencies]
to your Cargo.toml
[dependencies]
emoji256 = "0.2"
By default this will import std
, if you are working in a
no_std
environment you can turn this off by adding the following
[dependencies]
emoji256 = { version = "0.2", default-features = false }
std
: Enabled by default. Add support for Rust's libstd types.alloc
: Enabled by default. Add support for alloc types (e.g.String
) inno_std
environment.serde
: Disabled by default. Add support forserde
de/serializing library. See theserde
module documentation for usage.
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
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.