Skip to main content

Crate base64_light

Crate base64_light 

Source
Expand description

Base64 encoder and decoder.

A very simple Base64 library.

§Usage

use base64_light::*;
 
let raw = "hello!";
let enc = "aGVsbG8h";
assert_eq!(base64_encode(raw), enc);
assert_eq!(base64_decode_str(enc), raw);

Functions§

base64_decode
Decodes Base64 into Vec<u8>.
base64_decode_str
Decodes Base64 into a UTF-8 string (lossy).
base64_encode
Encodes a string to Base64.
base64_encode_bytes
Encodes bytes to Base64.
base64_encode_splitlines
Encodes a string to Base64 and inserts line breaks every 76 chars (for MIME).
base64_encode_splitlines_bytes
Encodes bytes to Base64 and inserts line breaks every 76 chars (for MIME).
base64_table_printer
For debugging: prints the Base64 decode table.
base64url_encode
Encodes a string to Base64URL.
base64url_encode_bytes
Encodes bytes to Base64URL.