10 releases

0.2.5 May 29, 2019
0.2.4 Jan 1, 2019
0.2.3 Aug 24, 2018
0.2.2 Feb 5, 2017
0.1.0 Mar 30, 2016

#8 in Value formatting

Download history 1581/week @ 2019-03-24 1567/week @ 2019-03-31 1523/week @ 2019-04-07 1624/week @ 2019-04-14 1660/week @ 2019-04-21 1656/week @ 2019-04-28 2037/week @ 2019-05-05 1794/week @ 2019-05-12 2141/week @ 2019-05-19 2363/week @ 2019-05-26 2850/week @ 2019-06-02 2564/week @ 2019-06-09 2488/week @ 2019-06-16 2736/week @ 2019-06-23 2285/week @ 2019-06-30

7,825 downloads per month
Used in 88 crates (5 directly)

MIT license

16KB
371 lines

base-x

Build Status

This is a Rust fork of https://github.com/cryptocoinjs/base-x And this my very first Rust project: please review the source code!

Installation

Add this to Cargo.toml file:

[dependencies]
base-x = "0.2.0"

Usage

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");
}

Changelog

  • 0.2.0

    Breaking change: alphabet has to be provided as an array of bytes instead of a string.

  • 0.1.0

    initial version

Contributors


lib.rs:

base_x

Encode and decode any base alphabet.

Installation

Add this to Cargo.toml file:

[dependencies]
base-x = "0.2.0"

Usage

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");
}

No runtime deps