ExBin v0.2.2 ExBin.Formatter View Source

Link to this section Summary

Functions

Pretty print a given binary. By default this will output in the same format as hexdump <file> from BSD general commands

Link to this section Functions

Link to this function

format_bytes(binary, opts \\ []) View Source

Pretty print a given binary. By default this will output in the same format as hexdump <file> from BSD general commands.

Examples

iex> ExBin.Formatter.format_bytes(<<0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20>>)
"0000000 0001 0203 0405 0607 0809 0a0b 0c0d 0e0f\n0000010 1011 1213 14"

iex> ExBin.Formatter.format_bytes(<<0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20>>, start: 0xa0)
"00000a0 0001 0203 0405 0607 0809 0a0b 0c0d 0e0f\n00000b0 1011 1213 14"