Module encoding

Source
Expand description

Some common encoding algorithms.

§Examples

§Encoding

use ncr::encoding::{Base64Encoding, Encoding};

let decoded = "#%Hello, world!";
let encoded = Base64Encoding::encode(decoded.as_bytes());

assert_eq!(encoded, "IyVIZWxsbywgd29ybGQh");

§Decoding

use ncr::encoding::{Base64Encoding, Encoding};

let encoded = "IyVIZWxsbywgd29ybGQh";
let decoded = Base64Encoding::decode(encoded).unwrap();

assert_eq!(String::from_utf8(decoded).unwrap(), "#%Hello, world!");

Structs§

Base64Encoding
The base64 encoding.
Base64rEncoding
The base64r encoding, made by No Chat Reports.
Mc256Encoding
The mc256 encoding, made by Sharp5s.
NewBase64rEncoding
The new base64r encoding, made by No Chat Reports.
Sus16Encoding
The sus16 encoding, made by EnderKill98.

Traits§

Encoding
The encoding trait.