Skip to main content

hex2file

A Python module for writing hex string content to a file.

What it does

Writes ascii hex strings to a file directly as in binary hex format. The string can be multi-line or single-line and 0x-prefixed or not. Excess whitespace in the input is ignored.

The following input (multi-line string):
0xFF00FF00
0xAABBCCDD
0x12345678
98765432 3456789A

Would result in the following file content:
FF00FF00AABBCCDD12345678987654323456789A

Compatibility

Python 2/3 compatible.

Install

Get the module via pip: pip install hex2file. Once installed 'hex2file' will be added to your path and the module will be available for importing in your Python projects.

Usage

Command Line

When pip installed, hex2file is added to your path. It can accept input directly from stdin or from a file with the '-f' flag. See hex2file --help.

Example: echo "0xFF00FF00" | hex2file /tmp/test

Library

The module can also be imported into a Python project. After installing it simply import hex2file and use hex2file.write().

Testing

Run the tests using python setup.py test from the root directory of this repository.

Metadata

Release files for hex2file 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hex2file 1.1.1
File Size Uploaded Provenance Actions
hex2file-1.1.1.tar.gz 3.7 kB Without provenance Details for hex2file-1.1.1.tar.gz

Release files / hex2file-1.1.1.tar.gz

Download URL hex2file-1.1.1.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a3d55a649bbf2c71c2d71726fe636cae0bb43339557f80c2dc3bab2319ba42bd
BLAKE2b-256 checksum
How to use checksums
7b37c52da9d937ee1ba075014640012c69a53baee95bb26e263c045a00450806
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

Security for hex2file 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page