Crates.io | byte_converter |
lib.rs | byte_converter |
version | 0.1.4 |
source | src |
created_at | 2024-10-29 00:53:33.189513 |
updated_at | 2024-11-21 02:49:45.070749 |
description | A Rust library for converting bytes to various units (KB, MB, GB, etc.). |
homepage | |
repository | |
max_upload_size | |
id | 1426246 |
size | 5,499 |
byte_converter is a Rust library for converting between bytes, kilobytes, and megabytes.
Add byte_converter to your Cargo.toml: [dependencies] byte_converter = "0.1.0"
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);
}
This project is licensed under the MIT License.
bensatlantik