Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/orkon/base-x-rs
Encode/decode any base
https://github.com/orkon/base-x-rs
base-x rust
Last synced: 5 days ago
JSON representation
Encode/decode any base
- Host: GitHub
- URL: https://github.com/orkon/base-x-rs
- Owner: OrKoN
- License: mit
- Created: 2016-03-30T20:11:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-06-24T12:54:14.000Z (over 2 years ago)
- Last Synced: 2024-12-17T04:05:41.587Z (6 days ago)
- Topics: base-x, rust
- Language: Rust
- Size: 58.6 KB
- Stars: 23
- Watchers: 7
- Forks: 15
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# base-x
[![Build Status](https://travis-ci.org/OrKoN/base-x-rs.svg?branch=master)](https://travis-ci.org/OrKoN/base-x-rs)
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!
## Installation
Add this to `Cargo.toml` file:
```toml
[dependencies]
base-x = "0.2.0"
```## Usage
```rust
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
- [Friedel Ziegelmayer](https://github.com/dignifiedquire)
- [Maciej Hirsz](https://github.com/maciejhirsz)