tick-encoding 0.1.4

A simple encoding scheme to encode binary data into ASCII strings
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![cfg(feature = "alloc")]

use tick_encoding::encode;

#[test]
fn test_encode() {
    assert_eq!(encode(b""), "");
    assert_eq!(encode(b"hello"), "hello");
    assert_eq!(encode(b"`"), "``");
    assert_eq!(encode(&[0xFF]), "`FF");
    assert_eq!(
        encode(b"hello world!\r\n\thi there"),
        "hello world!\r\n\thi there"
    );
    assert_eq!(encode("foo bar 🙂".as_bytes()), "foo bar `F0`9F`99`82");
}