https://github.com/niamster/unbytify
Convert units of digital information from string into the numeric equivalent and the other way around
https://github.com/niamster/unbytify
butify bytes convert crate format humanize parse rust unbytify units
Last synced: about 1 year ago
JSON representation
Convert units of digital information from string into the numeric equivalent and the other way around
- Host: GitHub
- URL: https://github.com/niamster/unbytify
- Owner: niamster
- License: apache-2.0
- Created: 2017-05-19T18:15:31.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-02-15T22:47:57.000Z (over 6 years ago)
- Last Synced: 2025-04-17T05:03:46.532Z (about 1 year ago)
- Topics: butify, bytes, convert, crate, format, humanize, parse, rust, unbytify, units
- Language: Rust
- Size: 13.7 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://crates.io/crates/unbytify)
[](https://docs.rs/unbytify)
[](https://travis-ci.org/niamster/unbytify)
[](https://ci.appveyor.com/project/niamster/unbytify)
[](https://codecov.io/gh/niamster/unbytify)
[](https://coveralls.io/github/niamster/unbytify?branch=master)
[](https://opensource.org/licenses/Apache-2.0)
# Unbytify - [Rust][rust] library to parse and represent digital units
### Table of Contents
* [Introduction](#introduction)
* [`unbytify` crate in your project](#in-your-project)
* [Usage](#usage)
* [License](#license)
* [Credits](#credits)
### Introduction
Unbytify converts KiB, MiB, etc. into integer and the other way around.
Sometimes people call this humanization.
### In your project
In Cargo.toml:
```toml
[dependencies]
unbytify = "0.2"
```
### Usage
In your `main.rs`:
```rust
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](https://docs.rs/unbytify).
### License
Unbytify project is licensed under Apache-2.0 license.
[rust]: http://rust-lang.org