#strong-typing #byte

pretty-bytes-typed

Strongly-typed prettified byte values

3 unstable releases

0.2.0 Oct 14, 2023
0.1.1 Aug 16, 2023
0.1.0 Aug 6, 2023

#11 in #strong-typing

25 downloads per month

MIT/Apache

14KB
320 lines

Pretty Bytes Typed

A simple, no-dependencies crate for converting a number of bytes into a strongly-typed representation of the "prettified" version of those bytes.

Compatible with serde! Designed for serializing possibly large byte values into JSON and sending to JavaScript code, since JS doesn't support full u64 values.

Inspired by/derived from https://github.com/sindresorhus/pretty-bytes.


lib.rs:

A simple, no-dependencies crate for converting a number of bytes into a strongly-typed (stack-allocated) representation of the "prettified" version of those bytes.

Compatible with serde when the serde feature is enabled.

Dependencies

~165KB