10 releases

Uses old Rust 2015

0.3.0 May 3, 2023
0.2.1 May 9, 2018
0.2.0 Aug 19, 2017
0.1.6 May 8, 2017
0.1.4 Mar 5, 2017

#53 in Visualization

Download history 757/week @ 2024-10-19 878/week @ 2024-10-26 530/week @ 2024-11-02 521/week @ 2024-11-09 1022/week @ 2024-11-16 525/week @ 2024-11-23 665/week @ 2024-11-30 739/week @ 2024-12-07 533/week @ 2024-12-14 294/week @ 2024-12-21 313/week @ 2024-12-28 560/week @ 2025-01-04 518/week @ 2025-01-11 578/week @ 2025-01-18 709/week @ 2025-01-25 569/week @ 2025-02-01

2,465 downloads per month
Used in 77 crates (7 directly)

MIT license

33KB
562 lines

Implements rust's Display trait to format a u8 slice as many hex editors do. This might be useful for dumping a binary blob for debugging purposes.

Build Status

Documentation

The API documentation can be found here: https://docs.rs/crate/hexplay/.

Example

Here's an example that prints a hex view of a slice of some vector's data:

extern crate hexplay;

use hexplay::HexViewBuilder;

fn main() {
    // The buffer we want to display
    let data : Vec<u8> = (0u8..200u8).collect();

    // Build a new HexView using the provider builder
    let view = HexViewBuilder::new(&data[40..72])
        .address_offset(40)
        .row_width(16)
        .finish();

    println!("{}", view);
}

This will result in the following output:

00000020                          28 29 2A 2B 2C 2D 2E 2F  |         ()*+,-./ |
00000030  30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F  | 0123456789:;<=>? |
00000040  40 41 42 43 44 45 46 47                          | @ABCDEFG         |

Installation

hexplay is on crates.io, so you can include it in your project like so:

[dependencies]
hexplay = "*"

Because this crate uses the ? operator, you need rust v1.13.0 or higher.

License

Hexplay is licensed under the terms of the MIT license.

Dependencies

~0–6.5MB
~35K SLoC