# cHexdump
Python module for creating pretty 'hexdumps' of data sequences.
# Install
cHexdump should work on all Python 2.7's and Python 3's. To install, use pip
```
python -m pip install chexdump
```
The in Python do something like:
```
from chexdump import hexdump, sideBySideHexdump
```
# Functionality
For full explanations of functionallity use help() on the given function. Here are some quick and dirty descriptions:
## hexdump()
hexdump() allows you to dump a sequence in terms of hex with an optional ASCII printout on the right. For example:
```
>>> print hexdump([1,2,3,4,5]* 10)
0000 01 02 03 04 05 01 02 03 04 05 01 02 03 04 05 01 ................
0010 02 03 04 05 01 02 03 04 05 01 02 03 04 05 01 02 ................
0020 03 04 05 01 02 03 04 05 01 02 03 04 05 01 02 03 ................
0030 04 05
# or
>>> print hexdump([1,2,3,4,5]* 10, showAscii=False)
0000 01 02 03 04 05 01 02 03 04 05 01 02 03 04 05 01
0010 02 03 04 05 01 02 03 04 05 01 02 03 04 05 01 02
0020 03 04 05 01 02 03 04 05 01 02 03 04 05 01 02 03
0030 04 05
# or
>>> print hexdump([1,2,3,4,5]* 10, showAscii=False, showIndexLabel=False)
01 02 03 04 05 01 02 03 04 05 01 02 03 04 05 01
02 03 04 05 01 02 03 04 05 01 02 03 04 05 01 02
03 04 05 01 02 03 04 05 01 02 03 04 05 01 02 03
04 05
# and so on...
```
## sideBySideHexdump()
sideBySideHexdump() is used to print 2 hexdumps side-by-side and point out to the user lines that differ. For example:
```
>>> a = [10,20,30,40,50] * 10
>>> b = a[:]
>>> b[38] = 12
>>> print sideBySideHexdump(a, b)
0000 0A 14 1E 28 32 0A 14 1E ...(2... | 0A 14 1E 28 32 0A 14 1E ...(2... |
0008 28 32 0A 14 1E 28 32 0A (2...(2. | 28 32 0A 14 1E 28 32 0A (2...(2. |
0010 14 1E 28 32 0A 14 1E 28 ..(2...( | 14 1E 28 32 0A 14 1E 28 ..(2...( |
0018 32 0A 14 1E 28 32 0A 14 2...(2.. | 32 0A 14 1E 28 32 0A 14 2...(2.. |
0020 1E 28 32 0A 14 1E 28 32 .(2...(2 | 1E 28 32 0A 14 1E 0C 32 .(2....2 | !
0028 0A 14 1E 28 32 0A 14 1E ...(2... | 0A 14 1E 28 32 0A 14 1E ...(2... |
0030 28 32 (2 | 28 32 (2 |
```
Python module for creating pretty 'hexdumps' of data sequences.
# Install
cHexdump should work on all Python 2.7's and Python 3's. To install, use pip
```
python -m pip install chexdump
```
The in Python do something like:
```
from chexdump import hexdump, sideBySideHexdump
```
# Functionality
For full explanations of functionallity use help() on the given function. Here are some quick and dirty descriptions:
## hexdump()
hexdump() allows you to dump a sequence in terms of hex with an optional ASCII printout on the right. For example:
```
>>> print hexdump([1,2,3,4,5]* 10)
0000 01 02 03 04 05 01 02 03 04 05 01 02 03 04 05 01 ................
0010 02 03 04 05 01 02 03 04 05 01 02 03 04 05 01 02 ................
0020 03 04 05 01 02 03 04 05 01 02 03 04 05 01 02 03 ................
0030 04 05
# or
>>> print hexdump([1,2,3,4,5]* 10, showAscii=False)
0000 01 02 03 04 05 01 02 03 04 05 01 02 03 04 05 01
0010 02 03 04 05 01 02 03 04 05 01 02 03 04 05 01 02
0020 03 04 05 01 02 03 04 05 01 02 03 04 05 01 02 03
0030 04 05
# or
>>> print hexdump([1,2,3,4,5]* 10, showAscii=False, showIndexLabel=False)
01 02 03 04 05 01 02 03 04 05 01 02 03 04 05 01
02 03 04 05 01 02 03 04 05 01 02 03 04 05 01 02
03 04 05 01 02 03 04 05 01 02 03 04 05 01 02 03
04 05
# and so on...
```
## sideBySideHexdump()
sideBySideHexdump() is used to print 2 hexdumps side-by-side and point out to the user lines that differ. For example:
```
>>> a = [10,20,30,40,50] * 10
>>> b = a[:]
>>> b[38] = 12
>>> print sideBySideHexdump(a, b)
0000 0A 14 1E 28 32 0A 14 1E ...(2... | 0A 14 1E 28 32 0A 14 1E ...(2... |
0008 28 32 0A 14 1E 28 32 0A (2...(2. | 28 32 0A 14 1E 28 32 0A (2...(2. |
0010 14 1E 28 32 0A 14 1E 28 ..(2...( | 14 1E 28 32 0A 14 1E 28 ..(2...( |
0018 32 0A 14 1E 28 32 0A 14 2...(2.. | 32 0A 14 1E 28 32 0A 14 2...(2.. |
0020 1E 28 32 0A 14 1E 28 32 .(2...(2 | 1E 28 32 0A 14 1E 0C 32 .(2....2 | !
0028 0A 14 1E 28 32 0A 14 1E ...(2... | 0A 14 1E 28 32 0A 14 1E ...(2... |
0030 28 32 (2 | 28 32 (2 |
```
Metadata
Release files for chexdump 0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| chexdump-0.8.zip | 7.6 kB | Details |
Release files / chexdump-0.8.zip
| Download URL | chexdump-0.8.zip |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a3ddde474b1375a624750e0540cb4b825f88c6987dbcb3ee2df1a24248cf5490
|
|
BLAKE2b-256 checksum How to use checksums |
50d5d95285ca1efca257f96240ae4ff0e4955c6d6ae5a977ebc7df338968ea0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |