pub fn formatted_dump(offset: u32, data: &[u8]) -> Vec<u8>Expand description
Create a formatted multi-line hex dump of the given data. Dump lines are prefixed with the given offset. Each line contains up to 16 bytes, separated by spaces, followed by a space and the ASCII representation.
ยงExamples
let data = &b"baadfood\xba\xad\xf0\x0dASDFasdf;lkj."[..];
let target = qdhex::formatted_dump(0x1000, &data);
assert_eq!(target, br"1000 62 61 61 64 66 6f 6f 64 ba ad f0 0d 41 53 44 46 baadfood....ASDF
1010 61 73 64 66 3b 6c 6b 6a 2e asdf;lkj.
");