Skip to main content

Crate base91le

Crate base91le 

Source
Expand description

base91le is an encoding that encode raw bytes into ascii in little-endian with 91 ascii character.

It’s more efficient than base64 that it encode 13 bytes to 16 bytes and it’s able to write training characters to hint how many bytes encoded in last 16 bytes chunk.

See KEYMAP for the characters the encoding used.

§Simple encode and decode

use base91le::{encode, decode};

assert_eq!(encode(b"hello"), "%;:w!;00~~~~~~~~");
assert_eq!(decode("BM1$A*00~~~~~~~~").unwrap(), b"world");

Modules§

read
Provides reader that decoded bytes read from given reader
ring
Fixed size ring-buffer to read and write
write
Provides writer that write encoded string to given writer

Enums§

DecodeError
errors that could happen when decoding

Constants§

KEYMAP
keymap used by the encoding

Functions§

decode
decode base91le encoded string to raw bytes
decode_chunk
decode a 16 bytes len chunk to given buf, returns decoded len
decode_chunks
decode base91le encoded string to raw bytes, with already checked length
encode
encode all bytes into a string
encode_chunk
encode a 13 bytes chunk into base91le encoding