Unbytify converts KiB, MiB, etc. into integer and the other way around.
Sometimes people call this humanization.
In Cargo.toml:
[dependencies]
unbytify = "0.1"
In your main.rs
:
``` extern crate unbytify; use unbytify::*;
fn main() { asserteq!(unbytify("1.5K"), Ok(1024 + 512)); asserteq!(bytify(1024 + 512), (1.5, "KiB")); } ```
Most of the useful documentation can be gotten using rustdoc.
Check it out on docs.rs/unbytify.
Unbytify project is licensed under Apache-2.0 license.