#bytes #convert #format #parse #humanize

unbytify

Convert units of digital information from string into the numeric equivalent and the other way around

3 unstable releases

Uses old Rust 2015

0.2.0 Apr 21, 2018
0.1.1 May 19, 2017
0.1.0 May 19, 2017

#84 in Value formatting

Download history 45/week @ 2021-08-10 28/week @ 2021-08-17 46/week @ 2021-08-24 18/week @ 2021-08-31 34/week @ 2021-09-07 37/week @ 2021-09-14 41/week @ 2021-09-21 16/week @ 2021-09-28 29/week @ 2021-10-05 32/week @ 2021-10-12 30/week @ 2021-10-19 27/week @ 2021-10-26 28/week @ 2021-11-02 25/week @ 2021-11-09 15/week @ 2021-11-16 23/week @ 2021-11-23

93 downloads per month
Used in 2 crates

Apache-2.0

10KB
148 lines

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.

Dependencies

~13KB