1 unstable release

Uses new Rust 2024

0.1.0 Sep 3, 2025

#7 in #reserved

33 downloads per month
Used in 3 crates (via swamp-abi-memtypes)

MIT license

3KB

💾 human-memsize

Make your byte sizes human-friendly. Because 1045678 looks scary, but 1 MiB feels just right.

License: MIT


✨ Features

  • 🧩 Binary units — Uses KiB, MiB, GiB, TiB
  • 🎯 Smart formatting:
    • Shows bytes up to 2 KiB for clarity.
    • Uses no decimals for exact numbers → 2 MiB, not 2.0 MiB.
    • Uses one decimal when needed → 1.5 MiB.

🛠️ Usage

Add to your Cargo.toml:

[dependencies]
human-memsize = "0.1"

Copyright 2025 Peter Bjorklund. All rights reserved.

No runtime deps