#base64 #string #format

base64-string-rs

A Rust crate for base64 string

1 unstable release

0.0.1 Jan 16, 2021

#145 in #base64

MIT/Apache

10KB
175 lines

base64-string-rs

A Rust crate for Base64 string.

Workflow Status crates.io docs.rs dependency status tokei

Install to Cargo.toml

Add this to your Cargo.toml:

[dependencies]
base64-string-rs = "<<version>>"

About Base64String

Base64String is a string type in Base64 format that contains meta-information about the encoding.

Usage

use base64_string_rs::Base64StringFactory;

let str = "0123ABC";
let factory = Base64StringFactory::default();
let encoded = factory.encode_from_string(str);
println!("encoded = {}", encoded);
// encoded = Base64String(value = MDEyM0FCQw, url_safe = false, padding = false)
let decoded = encoded.decode_to_string().unwrap();
println!("decoded = {}", decoded); // 0123ABC

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~1MB
~17K SLoC