…
Base91 Encoder transforms a string so that it conforms to the Base91 Data Encodings specification.
Base91 is not for encryption purposes and is not secure. It is an encoding mechanism only.
Base 91 is not for encryption purposes and is not secure. It is an encoding mechanism only.
An advanced technique for converting binary data into ASCII letters is base 91. It is comparable to base64 or UUencode but more effective. Base91 generates overhead depending on the input data. It can go as low as 14 percent, which often happens on 0-byte blocks, and reaches a maximum of 23 percent (as opposed to 33 percent for base64). Because of this, base 91 can be highly helpful for sending big data over unreliable binary connections, such as terminal lines or email.
Four of the 95 readable ASCII characters—the space (0x20), apostrophe (0x27), hyphen (0x2d), and backslash—are left out (0x5c).
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '#', '$',
'%', '&', '(', ')', '*', '+', ',', '.', '/', ':', ';', '<', '=',
'>', '?', '@', '[', ']', '^', '_', '`', '{', '|', '}', '~', '"'
[{ins-quote}]
let source = "This is a random binary string";
let encode_as_vec: Vec<u8> = base91::slice_encode(source.as_bytes());
let decode_as_vec: Vec<u8> = base91::slice_decode(&encode_as_vec);
Joachim Henke created the base91 binary-to-text encoding technique, often known as basE91. The binary data stream is split into 13-bit packets, which are subsequently encoded as two ASCII characters[2]. In general, the size of the encoded data will be 316 times bigger than the original, assuming eight bits per ASCII character. This is more effective than base85's 14 increase and base64's 13 increase (which utilizes four characters to represent three bytes of data) (which uses five characters to represent four bytes of data).
$
and "
in the digit alphabet.Binary Coded Decimal is a type of binary encoding that uses 4 binary numbers to represent the 10 digits from 0 to 9 in a decimal number.
Commenting your code is like cleaning your bathroom you never want to do it, but it really does create a more pleasant experience for you and your guests.
Ryan Campbell
…
…