hexprint
The hexprint module provides functionality to display binary data in a hexdump format with optional coloring and highlighting. It also includes a function to compare and highlight differences between two sets of data, as well as a function to highlight specific sequences within the data.
Installation
You can install the hexprint module using pip:
pip install hexprint
Usage Examples
hexprint
The hexprint function is used to print binary data in a hexdump format. You can optionally specify colored and highlighted indices.
Basic example:
from hexprint import hexprint
data = b'This is an example'
# Print binary data in a hexdump format
hexprint(data)
An example including coloring:
from hexprint import hexprint
data = b'This is an example'
# Print binary data with colored and highlighted indices
colored_indices = {0: 'red', 5: 'green'}
highlighted_indices = {2: 'yellow', 8: 'blue'}
hexprint(data, colored_indices=colored_indices, highlighted_indices=highlighted_indices)
compare
The compare function is used to compare and print two sets of data in a hexdump-like format, highlighting the differences.
from hexprint import compare
data1 = b'This is the example!'
data2 = b'This was an example'
# Compare and print the differences between two sets of data
compare(data1, data2)
highlight
The highlight function is used to highlight specific sequences within binary data.
from hexprint import highlight
data = b'This is an example. This is another example.'
# Highlight specific sequences within the data
sequences = [b'This', b'another']
highlight(data, sequences=sequences)
License
This project is licensed under the MIT License. See the LICENSE file for details.
Release files for hexprint 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hexprint-0.1.tar.gz | 2.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hexprint-0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.4 kB
Release files / hexprint-0.1.tar.gz
| Download URL | hexprint-0.1.tar.gz |
|---|---|
| Size | 2.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bc05064825c4aeb32e5366ad8e5ac2ada7aaf8f8c722f7d91cdc24c0f2b91fe6
|
|
BLAKE2b-256 checksum How to use checksums |
19904f1a67ad16a5831346f74aa42c1cd474001077f8f36d69d592c8f096272c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Release files / hexprint-0.1-py3-none-any.whl
| Download URL | hexprint-0.1-py3-none-any.whl |
|---|---|
| Size | 2.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
59bd67fc97c666b90c3216530ffa9a1c32857184535ad17418d92c76d3e3b12c
|
|
BLAKE2b-256 checksum How to use checksums |
c8e73097bf47902546662d17742c420a221ce3107d36ce55d59e5f346c6b6c7d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|