KittenMoji ========== This is a KittenMoji encoder/decoder written in rust. This crate is written in 100% safe rust and has no external dependencies. What is KittenMoji? ------------------- KittenMoji is a base 256 binary-to-text encoding that uses emojis as encoding units. It originates from the [Small Web development kit Kitten](https://kitten.small-web.org/reference/#cryptographical-properties), where it is used to encode cryptographic keys. ### Why? You can say a lot of things against KittenMoji. For example, it is terribly inefficient. Even a hexadecimal binary-to-text encoding encodes each byte as only two bytes. KittenMoji, encoded as utf-8, uses 4 bytes per byte. However, it looks nice, it's kind of cute and [someone on Mastodon pointed out](https://retro.social/@freakazoid/113136664997476020) that many platforms with character limits (e.g. Mastodon) count emojis as only one character. Personally, I just wrote this crate for the joy of it, not for any practical use. Usage ----- ### Example usage in rust code ```rust let kitten_encoded = encode_slice(b"kitten"); assert_eq!(kitten_encoded, "πŸ§¬πŸŽ­πŸŒΊπŸŒΊπŸπŸ’"); let kitten_decoded = decode_str("πŸ§¬πŸŽ­πŸŒΊπŸŒΊπŸπŸ’").unwrap(); assert_eq!(kitten_decoded, b"kitten"); ``` ### Example binaries There are two example binaries: `encode` and `decode`. They take input from stdin, encode/decode it and write the result to stdin. Both have a constant memory footprint and can be used to encode or decode large files. ``` echo -n "kitten" | cargo run --release --example encode ``` License ------- This project is licensed under the [GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.html).