Crates.io | based |
lib.rs | based |
version | 1.0.0 |
source | src |
created_at | 2020-03-29 00:14:49.907096 |
updated_at | 2020-05-30 19:51:07.34581 |
description | Custom numeral systems |
homepage | |
repository | https://github.com/Yam76/based |
max_upload_size | |
id | 223925 |
size | 11,463 |
based
provides support for custom numerical bases. based
does not support multi-character digits.
use based::{Base, NumeralSystem};
let base16: Base = "0123456789abcdef".parse().unwrap();
let val: usize = base16.decode("10").unwrap();
assert_eq!(val, 16);
assert_eq!(base16.encode(16 as usize).unwrap(), "10")