| Crates.io | byte-repr |
| lib.rs | byte-repr |
| version | 0.2.0 |
| created_at | 2025-04-09 14:15:21.196459+00 |
| updated_at | 2025-04-10 07:35:38.510217+00 |
| description | A utility to inspect binary, little-endian, and big-endian memory representations of numbers. |
| homepage | |
| repository | https://github.com/himangshu-blockchain/byte-repr |
| max_upload_size | |
| id | 1626859 |
| size | 32,173 |
A lightweight utility for inspecting and learning about memory representation of integer types in Rust.
byte-repr is a simple, extensible Rust crate to help visualize how numeric types are represented in memory. It supports both little-endian and big-endian byte formats, binary representation, and hex with zero-padding.
Useful for:
Add this to your Cargo.toml:
[dependencies]
byte-repr = "0.1.0" # update after publishing
Then use in your code:
use byte_repr::represent;
fn main() {
let x = 42u16;
represent(&x);
}

Currently supports:
i8u16u32u64u128usizeโ
impl_byterep! macro makes it easy to extend support to custom numeric types.
โ Not yet #![no_std] compatible
โ No support for wasm32 (WebAssembly) targets
๐ Relies on println! for display, which isn't available in no_std or wasm
โ These will be addressed in upcoming versions. Stay tuned!
Includes integration tests for:
See the LICENSE-MIT file for details.
See CHANGELOG.md for a history of changes.
Made with โค๏ธ by Himangshu Pan