Function to_hexdump_pos

Source
pub const fn to_hexdump_pos(bytes_pos: usize) -> usize
Expand description

Calculates the position in the hexdump output where the byte at the given binary error position will appear.

The hexdump format for reference:

00000000: 48 65 6c 6c 6f 20 57 6f 72 6c 64 21 0a                  Hello World!

In this format:

  • The first 8 characters are the offset (00000000).
  • The next 2 characters are a colon and a space (: ).
  • The next 48 characters are the hexadecimal representation of the 16 bytes of data(48 65 6c 6c 6f 20 57 6f 72 6c 64 21 0a).
  • The last 16 characters are the ASCII representation of the 16 bytes of data (Hello World!).

Each line represents 16 bytes of the binary data.