Crate kittenmoji

Source
Expand description

This crate is for encoding and decoding KittenMoji, a base 256 binary-to-text encoding inspired by the Kitten Small Web development kit.

Β§Examples

Β§Encode and decode

use kittenmoji::{encode_slice, decode_str};

let kitten_encoded = encode_slice(b"kitten");
assert_eq!(kitten_encoded, "πŸ§¬πŸŽ­πŸŒΊπŸŒΊπŸπŸ’");

let kitten_decoded = decode_str("πŸ§¬πŸŽ­πŸŒΊπŸŒΊπŸπŸ’").unwrap();
assert_eq!(kitten_decoded, b"kitten");

StructsΒ§

DecodeError
This error is returned when decoding failed because the given code point is not one of the 256 KittenMoji emojis and thus cannot be decoded.

FunctionsΒ§

decode
Returns an iterator that decodes the kittenmoji input.
decode_str
Decodes a kittenmoji string
decode_stream
Reads kittenmoji strings from the (utf-8) input and writes the decoded bytes to the output
encode
Returns an iterator that encodes all input bytes as kittenmoji
encode_slice
Encodes a byte slice as kittenmoji
encode_stream
Reads bytes from the input and writes them as utf-8 encoded kittenmoji to output