base64_light

Crates.iobase64_light
lib.rsbase64_light
version0.1.5
sourcesrc
created_at2023-02-19 15:15:12.287874
updated_at2023-02-20 05:49:26.000846
descriptionBase64 Encoder & Decoder
homepage
repositoryhttps://github.com/kujirahand/rust-base64-light
max_upload_size
id789081
size19,587
kujirahand (kujirahand)

documentation

https://docs.rs/base64_light

README

base64_light

Base64 Encoder, Decoder for Rust. This is very simple Base64 library.

How to use

Add 'base64_light' to your project's Cargo.toml.

[package]
...
[dependencies]
base64_light = "0.1"

And use 'base64_encode()' or 'base64_decode_str()' etc ...

use base64_light::*;
fn main() {
    let s = "hello!";
    println!("{} => {}", s, base64_encode(s)); // hello! => aGVsbG8h
    let b = "aGVsbG8h";
    println!("{} <= {}", b, base64_decode_str(b)); // aGVsbG8h <= hello!
}

Methods

Encode

  • base64_encode(in_str: &str) -> String

  • base64_encode_bytes(in_bytes: &[u8]) -> String

  • base64url_encode(in_str: &str) -> String

  • base64url_encode_bytes(bytes: &[u8]) -> String

  • base64_encode_splitlines(in_str: &str) -> String

  • base64_encode_splitlines_bytes(in_bytes: &[u8])

Decode

  • pub fn base64_decode(b64str: &str) -> Vec<u8>
  • pub fn base64_decode_str(b64str: &str) -> String

Link

Commit count: 12

cargo fmt