#parse #byte #convert

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

#377 in #parse

Download history 164/week @ 2024-07-22 183/week @ 2024-07-29 252/week @ 2024-08-05 160/week @ 2024-08-12 84/week @ 2024-08-19 148/week @ 2024-08-26 218/week @ 2024-09-02 120/week @ 2024-09-09 114/week @ 2024-09-16 184/week @ 2024-09-23 119/week @ 2024-09-30 111/week @ 2024-10-07 165/week @ 2024-10-14 102/week @ 2024-10-21 158/week @ 2024-10-28 110/week @ 2024-11-04

550 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