Crates.io | base-x |
lib.rs | base-x |
version | 0.2.11 |
source | src |
created_at | 2016-03-30 20:16:02.348858 |
updated_at | 2022-06-24 12:54:18.725133 |
description | Encode/decode any base |
homepage | https://github.com/OrKoN/base-x-rs |
repository | https://github.com/OrKoN/base-x-rs |
max_upload_size | |
id | 4626 |
size | 33,388 |
This is a Rust fork of https://github.com/cryptocoinjs/base-x
WARNING: This module is NOT RFC3548 compliant, it cannot be used for base16 (hex), base32, or base64 encoding in a standards compliant manner.
And this my very first Rust project: please review the source code!
Add this to Cargo.toml
file:
[dependencies]
base-x = "0.2.0"
extern crate base_x;
fn main() {
let decoded = base_x::decode("01", "11111111000000001111111100000000").unwrap();
let encoded = base_x::encode("01", &decoded);
assert_eq!(encoded, "11111111000000001111111100000000");
}
0.2.0
Breaking change: alphabet has to be provided as an array of bytes instead of a string.
0.1.0
initial version