byte_converter

Crates.iobyte_converter
lib.rsbyte_converter
version0.1.4
sourcesrc
created_at2024-10-29 00:53:33.189513
updated_at2024-11-21 02:49:45.070749
descriptionA Rust library for converting bytes to various units (KB, MB, GB, etc.).
homepage
repository
max_upload_size
id1426246
size5,499
Ben Santora (bensatlantik)

documentation

README

byte_converter

byte_converter is a Rust library for converting between bytes, kilobytes, and megabytes.

Installation

Add byte_converter to your Cargo.toml: [dependencies] byte_converter = "0.1.0"

Usage

Then, you can use the conversion functions:

use byte_converter::{bytes_to_kb, kb_to_mb};

fn main() {
    let kb = bytes_to_kb(2048);
    println!("2048 bytes is {} KB", kb);

    let mb = kb_to_mb(2048.0);
    println!("2048 KB is {} MB", mb);
}

License

This project is licensed under the MIT License.

Author

bensatlantik

Commit count: 0

cargo fmt