Format bytes as a classic hex dump.
hexdump [-n
length
] [-s
offset
]
file
...
Display a hex dump of the specified files. Woefully incomplete, but it works.
-
-n
length
Interpret only
length
bytes of the inputs. Only accepts decimal numbers. -
-s
offset
Skip
offset
bytes from the inputs. Only accepts decimal numbers.
Not available on crates.io sorry...
extern crate hexdump;
use hexdump::hexdump;
const BYTES: &'static [u8] = b"\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF";
assert_eq!(format!("{}", hexdump(BYTES, 32)),
"00000020: 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF |..\"3DUfw........|\n");
More in the documentation, which is only available after you run cargo doc
.
MIT, see license.txt