unbytify

Crates.iounbytify
lib.rsunbytify
version0.2.0
created_at2017-05-19 18:18:20.047052+00
updated_at2018-04-21 03:17:28.798122+00
descriptionConvert units of digital information from string into the numeric equivalent and the other way around
homepagehttps://github.com/niamster/unbytify
repositoryhttps://github.com/niamster/unbytify
max_upload_size
id15198
size24,881
Dmytro Milinevskyi (niamster)

documentation

https://docs.rs/unbytify

README

Crates.io Docs.rs Linux Build Status Windows Build Status Codecov Coveralls License

Unbytify - Rust library to parse and represent digital units

Table of Contents

Introduction

Unbytify converts KiB, MiB, etc. into integer and the other way around.

Sometimes people call this humanization.

In your project

In Cargo.toml:

[dependencies]
unbytify = "0.2"

Usage

In your main.rs:

extern crate unbytify;
use unbytify::*;

fn main() {
    assert_eq!(unbytify("1.5K"), Ok(1024 + 512));
    assert_eq!(bytify(1024 + 512), (1.5, "KiB"));
}

Documentation

Most of the useful documentation can be gotten using rustdoc.

Check it out on docs.rs/unbytify.

License

Unbytify project is licensed under Apache-2.0 license.

Commit count: 0

cargo fmt