| Crates.io | anybase |
| lib.rs | anybase |
| version | 0.2.3 |
| created_at | 2025-12-02 09:39:35.481377+00 |
| updated_at | 2025-12-06 09:45:41.408462+00 |
| description | High-performance arbitrary base integer conversion library |
| homepage | |
| repository | https://github.com/Volyyig/anybase |
| max_upload_size | |
| id | 1961446 |
| size | 39,961 |
A Rust library for converting numbers between arbitrary bases.
Run the following command in your project directory:
cargo add anybase
use anybase::{convert_base, Converter};
// Functional
let result = convert_base("ff", "0123456789abcdef", "01234567").unwrap();
assert_eq!(result, "377");
// Object-oriented
let converter = Converter::new("01", "0123456789");
let result = converter.convert("1010").unwrap();
assert_eq!(result, "10");
MIT OR Apache-2.0
Contributions welcome! Please open an issue or submit a pull request.