#convert #byte #humanize #parse #format

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

#2860 in Parser implementations

Download history 348/week @ 2023-12-18 79/week @ 2023-12-25 187/week @ 2024-01-01 161/week @ 2024-01-08 248/week @ 2024-01-15 224/week @ 2024-01-22 300/week @ 2024-01-29 337/week @ 2024-02-05 224/week @ 2024-02-12 341/week @ 2024-02-19 292/week @ 2024-02-26 369/week @ 2024-03-04 300/week @ 2024-03-11 305/week @ 2024-03-18 268/week @ 2024-03-25 308/week @ 2024-04-01

1,217 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

~14KB