sdr.hexdump(data: ArrayLike | bytes, width: int = 16) str

Returns a hexdump of the specified data.

Parameters:
data: ArrayLike | bytes

The data to display. Each element is considered one byte. Use sdr.pack() or sdr.unpack() to convert data with variable bits per element.

width: int = 16

The number of bytes per line.

Returns:

A string containing the hexdump of the data.

Examples

In [1]: print(sdr.hexdump(b"The quick brown fox jumps over the lazy dog"))
00000000  54 68 65 20 71 75 69 63 6b 20 62 72 6f 77 6e 20  The quick brown 
00000010  66 6f 78 20 6a 75 6d 70 73 20 6f 76 65 72 20 74  fox jumps over t
00000020  68 65 20 6c 61 7a 79 20 64 6f 67                 he lazy dog
In [2]: print(sdr.hexdump([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], width=4))
00000000  01 02 03 04  ....
00000004  05 06 07 08  ....
00000008  09 0a        ..