libgs.utils.bytes2prettyhex

libgs.utils.bytes2prettyhex(data, whitespacelen=79)[source]

Helper function to convert a bytearray to a pretty printed hex string.

Example:

>>> print(bytes2prettyhex(range(59), whitespacelen=10))
      000000  00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F
      000010  10-11-12-13-14-15-16-17-18-19-1A-1B-1C-1D-1E-1F
      000020  20-21-22-23-24-25-26-27-28-29-2A-2B-2C-2D-2E-2F
      000030  30-31-32-33-34-35-36-37-38-39-3A