Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (
Help us improve Python packaging - Donate today!

Hexdump module and script

Project Description

# xd_gen

xd.hexdump provides the core function. It is a generator with the following signature:

(file, offset=0, start=0, stop=None, step=16, sep=’x08’)

where file is a binary file, offset adjusts the address column, start and stop denote how far into the file to start reading and at which byte to stop and step sets how many bytes are displayed per row. sep defaults to backspace but will accept a different character to separate the rows.

xd.hexdump provides another generator that makes use of the above by yielding a * instead of a duplicate row, omitting any following repetitions. If this occurs at EOF, the very last row will be shown to indicate just how many duplicates there were.

In the same module are four other functions used by test_xd.tests that will get the integer base 16 value of each hex formatted character in a given hexdump. xd.hexdump.wb may be used to restore a binary file.

To run from the command line, xd.run_hexdump takes in as many arguments as xd.hexdump.hexdump_gen, named the same plus --compress, and will write to stdout.

To test, add binary files to test_xd\test_samples.

Release History

Release History

This version
History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date (5.6 kB) Copy SHA256 Checksum SHA256 Source Jun 11, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting