8 releases

0.2.3 Aug 24, 2018
0.2.2 Feb 5, 2017
0.1.3 Jan 26, 2017
0.1.2 Apr 10, 2016
0.1.0 Mar 30, 2016

#7 in Value formatting

Download history 1097/week @ 2018-08-10 912/week @ 2018-08-17 1010/week @ 2018-08-24 1257/week @ 2018-08-31 1178/week @ 2018-09-07 1251/week @ 2018-09-14 1760/week @ 2018-09-21 1249/week @ 2018-09-28 1548/week @ 2018-10-05 1413/week @ 2018-10-12 1376/week @ 2018-10-19 1057/week @ 2018-10-26 1483/week @ 2018-11-02

5,435 downloads per month
Used in 40 crates (4 directly)

MIT license Custom license

15KB
343 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