hex-utils

Xxd output from binary input with configurable formatting."

Documentation

toml [dependencies] hex_utils = "*"

Get iterator over formatted output as (offset, hexoutput, asciioutput).

```rust extern crate hex_utils;

let text = "The quick brown fox jumps over the lazy dog";

for (offset, hex, txt) in hexutils::xxd(text.asbytes(), None) { println!("offset = {:03x} hex = {:60} txt = {}", offset, hex, txt.unwrap()); } ```

```rust extern crate hex_utils;

let text = "The quick brown fox jumps over the lazy dog"; let format = hexutils::Format { size: 18, pack: vec![3,6], asciinone: '-', ascii: true, gaps:(4,2), };

let fmt = format.formatter();

for line in hexutils::xxd(text.asbytes(), Some(format)) { println!("{}", fmt(line)); } ```

Or one huge formatted string. ```rust extern crate hex_utils;

let text = "The quick brown fox jumps over the lazy dog";

println!("{}", hexutils::xxdstr(text.as_bytes(), None)); ```