Convert [Python dictionary | ASCII JSON string] into hexadecimal string.
Project description
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
d = {"hello": "world"}
hex_s = hex_serialize(d)
print(hex_s) # 0x10b9af5bde033362715ac3e14a8e3a374e572b9923e4d
d = hex_deserialize(hex_s)
print(d) # {'hello': 'world'}
print(type(d)) # <class 'str'>
Convert and restore ASCII JSON string
d = '{"hello": "world"}'
hex_s = hex_serialize(d)
print(hex_s) # 0x389e07d8b54506b764401133595ffdc3b1729818953c64e47bc3ddbac98cea
d = hex_deserialize(hex_s)
print(d) # {"hello": "world"}
print(type(d)) # <class 'str'>
Tests
tox
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for hex_json-0.0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b7d37b4f463b72061d6c508983592413810d5071f953da0b6cf00351512eb42 |
|
MD5 | 9e5202c15ebe14b93f235a455eff8bab |
|
BLAKE2b-256 | 1821956e4e6384835ce705d13bdd9c4614f3d5139af449544222fcf1d5ed5334 |