bittenhumans
A lightweight, simple byte size humanization library for Rust.
Features
- Supports both decimal (KB, MB, GB) and binary (KiB, MiB, GiB) numeral systems
- Automatic magnitude selection for appropriate unit sizing
- IEC-compliant formatting with "i" infix for binary units
- Configurable formatting with reusable formatters
Installation
Add this to your Cargo.toml:
[]
= "1.0.0"
Usage
Basic Usage
use ByteSizeFormatter;
use System;
Creating Reusable Formatters
use ByteSizeFormatter;
use ;
Creating Size-Appropriate Formatters
use ByteSizeFormatter;
use System;
Documentation
For more detailed information, check the API documentation.
Use Cases
- Status bars and system monitors
- File managers and download managers
- System information displays
- Anywhere byte sizes need to be displayed in a human-readable format
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.