Crates.io | base64-string-rs |
lib.rs | base64-string-rs |
version | 0.0.1 |
source | src |
created_at | 2021-01-16 12:12:59.178616 |
updated_at | 2021-01-16 12:12:59.178616 |
description | A Rust crate for base64 string |
homepage | |
repository | https://github.com/j5ik2o/base64-string-rs |
max_upload_size | |
id | 342775 |
size | 23,548 |
A Rust crate for Base64 string.
Add this to your Cargo.toml
:
[dependencies]
base64-string-rs = "<<version>>"
Base64String is a string type in Base64 format that contains meta-information about the encoding.
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
Licensed under either of
at your option.
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.