1 unstable release
0.0.1 | Jan 16, 2021 |
---|
#159 in #base64
56 downloads per month
Used in 3 crates
(2 directly)
10KB
175 lines
base64-string-rs
A Rust crate for Base64 string.
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
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
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