2 releases

0.0.3 Sep 28, 2024
0.0.1 Sep 22, 2024

#2625 in Text processing

Download history 2/week @ 2025-09-10 16/week @ 2025-09-17 31/week @ 2025-09-24 39/week @ 2025-10-01 14/week @ 2025-10-08 24/week @ 2025-10-15 45/week @ 2025-10-22 13/week @ 2025-10-29 14/week @ 2025-11-05 18/week @ 2025-11-12 11/week @ 2025-11-19 14/week @ 2025-11-26 15/week @ 2025-12-03

62 downloads per month
Used in 10 crates (7 directly)

MIT license

16KB
207 lines

hexify

hexify is a Rust library for formatting octet slices [u8] into hexadecimal strings. It provides utilities to convert octets into easily readable hex strings with additional features for comparison and assertions.

Installation

Add hexify to your Cargo.toml:

[dependencies]
hexify = "^0.0.1"

Usage

use hexify::format_hex;

fn main() {
    let data = [0x42, 0xA4, 0xAE, 0x09, 0xAF, 0x00, 0x01, 0x00, 0x00, 0x04, 0x03, 0x00, 0x00];
    let output = format_hex(&data);
    println!("{}", output); // Outputs: 42 A4 AE 09 AF 00 01 00 00 04 03 00 00
}

Features

  • Hexadecimal Formatting: Convert [u8] slices into uppercase, space-separated hex strings.
  • Comparison and Assertions: Easily compare octet slices and assert equality with detailed hex dump outputs for debugging.
  • Flexible Formatting Options: Customize grouping and prefix options for hex output.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Dependencies

~100KB