Dump a line of hexadecimal numbers from binary data. @type data: str @param data: Binary data. @type separator: str @param separator: Separator between the hexadecimal representation of each character. @type width: int @param
(cls, data, separator=" ", width=None)
| 612 | |
| 613 | @classmethod |
| 614 | def hexline(cls, data, separator=" ", width=None): |
| 615 | """ |
| 616 | Dump a line of hexadecimal numbers from binary data. |
| 617 | |
| 618 | @type data: str |
| 619 | @param data: Binary data. |
| 620 | |
| 621 | @type separator: str |
| 622 | @param separator: |
| 623 | Separator between the hexadecimal representation of each character. |
| 624 | |
| 625 | @type width: int |
| 626 | @param width: |
| 627 | (Optional) Maximum number of characters to convert per text line. |
| 628 | This value is also used for padding. |
| 629 | |
| 630 | @rtype: str |
| 631 | @return: Multiline output text. |
| 632 | """ |
| 633 | if width is None: |
| 634 | fmt = "%s %s" |
| 635 | else: |
| 636 | fmt = "%%-%ds %%-%ds" % ((len(separator) + 2) * width - 1, width) |
| 637 | return fmt % (cls.hexadecimal(data, separator), cls.printable(data)) |
| 638 | |
| 639 | @classmethod |
| 640 | def hexblock(cls, data, address=None, bits=None, separator=" ", width=8): |
no test coverage detected