Skip to main content

hex-json

Convert [python dictionary | ASCII JSON string] into hexadecimal string.
Restore from a hexadecimal string to [python dictionary | ASCII JSON string].
Useful for ethereum transaction data signature.

https://github.com/Sobolev5/hex-json

Install

To install run:

pip install hex-json

Convert and restore dict

from hex_json import hex_serialize, hex_deserialize

d = {"hello": "world"}
hex_s = hex_serialize(d)
print(hex_s) # 7b2268656c6c6f223a22776f726c64227d

d = hex_deserialize(hex_s)
print(d) # {'hello': 'world'}
print(type(d)) # <class 'str'>

Convert and restore ASCII JSON string

from hex_json import hex_serialize, hex_deserialize

s = '{"hello": "world"}'
hex_s = hex_serialize(s)
print(hex_s) # 227b5c2268656c6c6f5c223a205c22776f726c645c227d22

s = hex_deserialize(hex_s)
print(s) # {"hello": "world"}
print(type(s)) # <class 'str'>

Tests

tox

Metadata

Release files for hex-json 0.0.2.1

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

Built distribution (wheel)

Table of built distributions (wheels) for hex-json 0.0.2.1
File Interpreter ABI Platform Actions
hex_json-0.0.2.1-py3-none-any.whl Python 3 none any Details for hex_json-0.0.2.1-py3-none-any.whl

Release files / hex_json-0.0.2.1-py3-none-any.whl

Download URL hex_json-0.0.2.1-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
292dba7ad7ffe50a3cebcacfa9e8411bd50abe4b1f2a5bb09153872b88d28557
BLAKE2b-256 checksum
How to use checksums
081526999c500c84aaa507f1576456c47b1697892e335e694df386d66c17f3ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.2

Security for hex-json 0.0.2.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.

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