hoshrust (see hosh for the implementation of the current specification)
Fast cryptographic 22-digit hash and operators for Rust and Python. This is based on the Symmetric group, which is not robust to many repetitions (see hosh for a robust 40-digit version).
Python installation
from package
# Set up a virtualenv.
python3 -m venv venv
source venv/bin/activate
# Install from PyPI
pip install hoshrust
from source
cd my-project
git clone https://github.com/davips/hoshrust ../hoshrust
pip install -e ../hoshrust
Examples
Basic operations
from hoshrust import Hash
# Hashes can be multiplied.
a = Hash(blob=b"Some large binary content...")
b = Hash(blob=b"Some other binary content. Might be, e.g., an action or another large content.")
c = a * b
print(f"{a} * {b} = {c}")
"""
0v58YxIhaae5NfYuXsoC1i * 04orKjYHAZraYORILOVwos = 3yT1A5oLlW2HpjSkgzo2yg
"""
# Multiplication can be reverted by the inverse hash. Zero is the identity hash.
print(f"{b} * {~b} = {b * ~b} = 0")
"""
04orKjYHAZraYORILOVwos * 211eErwhEiGnit0beo4tjo = 0000000000000000000000 = 0
"""
print(f"{c} * {~b} = {c * ~b} = {a} = a")
"""
3yT1A5oLlW2HpjSkgzo2yg * 211eErwhEiGnit0beo4tjo = 0v58YxIhaae5NfYuXsoC1i = 0v58YxIhaae5NfYuXsoC1i = a
"""
print(f"{~a} * {c} = {~a * c} = {b} = b")
"""
4q4X1jczNK2eKCV4uxEPNk * 3yT1A5oLlW2HpjSkgzo2yg = 04orKjYHAZraYORILOVwos = 04orKjYHAZraYORILOVwos = b
"""
# Division is shorthand for reversion.
print(f"{c} / {b} = {c / b} = a")
"""
3yT1A5oLlW2HpjSkgzo2yg / 04orKjYHAZraYORILOVwos = 0v58YxIhaae5NfYuXsoC1i = a
"""
# Hash multiplication is not expected to be commutative.
print(f"{a * b} != {b * a}")
"""
3yT1A5oLlW2HpjSkgzo2yg != 4AvOF9Fbhakd26mosfuuvR
"""
# Hash multiplication is associative.
print(f"{a * (b * c)} = {(a * b) * c}")
"""
51UdYbEAGI5mVogE4aFFKe = 51UdYbEAGI5mVogE4aFFKe
"""
Features
Metadata
Release files for hoshrust 0.211225.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hoshrust-0.211225.0.tar.gz | 6.1 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| hoshrust-0.211225.0-cp39-cp39-manylinux2010_x86_64.whl | CPython 3.9 | CPython 3.9 | Linux glibc 2.12+ x86-64 | Details |
| hoshrust-0.211225.0-cp39-cp39-manylinux1_x86_64.whl | CPython 3.9 | CPython 3.9 | Linux glibc 2.5+ x86-64 | Details |
| hoshrust-0.211225.0-cp38-cp38-manylinux2010_x86_64.whl | CPython 3.8 | CPython 3.8 | Linux glibc 2.12+ x86-64 | Details |
| hoshrust-0.211225.0-cp38-cp38-manylinux1_x86_64.whl | CPython 3.8 | CPython 3.8 | Linux glibc 2.5+ x86-64 | Details |
| hoshrust-0.211225.0-cp37-cp37m-manylinux2010_x86_64.whl | CPython 3.7 | CPython 3.7 pymalloc | Linux glibc 2.12+ x86-64 | Details |
| hoshrust-0.211225.0-cp37-cp37m-manylinux1_x86_64.whl | CPython 3.7 | CPython 3.7 pymalloc | Linux glibc 2.5+ x86-64 | Details |
| hoshrust-0.211225.0-cp36-cp36m-manylinux2010_x86_64.whl | CPython 3.6 | CPython 3.6 pymalloc | Linux glibc 2.12+ x86-64 | Details |
| hoshrust-0.211225.0-cp36-cp36m-manylinux1_x86_64.whl | CPython 3.6 | CPython 3.6 pymalloc | Linux glibc 2.5+ x86-64 | Details |
Total release size: 10.6 MB
Release files / hoshrust-0.211225.0.tar.gz
| Download URL | hoshrust-0.211225.0.tar.gz |
|---|---|
| Size | 6.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
62d3dda0600252c52472af4db3f338de6ca5acd4fa27f0feb9f7d0444a183e1a
|
|
BLAKE2b-256 checksum How to use checksums |
e7aaf49aabdeacc39d58e467419965a6e90a7ebb3701ab4bb00da20cb3dbb241
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Release files / hoshrust-0.211225.0-cp39-cp39-manylinux2010_x86_64.whl
| Download URL | hoshrust-0.211225.0-cp39-cp39-manylinux2010_x86_64.whl |
|---|---|
| Size | 559.5 kB |
| Tags | CPython 3.9 Linux glibc 2.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
d1cde29e2295b41822d92ef380a5df661354a7ebd0bc97e9b1d93d6c443e09fd
|
|
BLAKE2b-256 checksum How to use checksums |
dbbb2f6306c10dd8abc3960f8739bd263b5432392b4a9ddf575d930d78ffffc3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Release files / hoshrust-0.211225.0-cp39-cp39-manylinux1_x86_64.whl
| Download URL | hoshrust-0.211225.0-cp39-cp39-manylinux1_x86_64.whl |
|---|---|
| Size | 559.5 kB |
| Tags | CPython 3.9 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
afa4830d984ea461de89357d49bab48d242dc3b0c27c1a565e1f977c2e3dc243
|
|
BLAKE2b-256 checksum How to use checksums |
b3205d873391788b2935bc104dda39eb94daa558fa8cbd386063b447ca1f9a3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Release files / hoshrust-0.211225.0-cp38-cp38-manylinux2010_x86_64.whl
| Download URL | hoshrust-0.211225.0-cp38-cp38-manylinux2010_x86_64.whl |
|---|---|
| Size | 559.6 kB |
| Tags | CPython 3.8 Linux glibc 2.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
e873044953047a5d873a119721d8286d5d1fa16abf0b77228ba4a87f64b7725e
|
|
BLAKE2b-256 checksum How to use checksums |
8ed228c6a5d35149536e8f981b5e6465ac0a5147a1c5cc486c7f22cffab213bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Release files / hoshrust-0.211225.0-cp38-cp38-manylinux1_x86_64.whl
| Download URL | hoshrust-0.211225.0-cp38-cp38-manylinux1_x86_64.whl |
|---|---|
| Size | 559.6 kB |
| Tags | CPython 3.8 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
d5de4edd133dbcb59035980b18e8a27c27af8a6e78ca2abeaf4610c320aa3b81
|
|
BLAKE2b-256 checksum How to use checksums |
4833206e4d49b33027baeb90368227b23e4e09add302f8a52ae02b54716f5a0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Release files / hoshrust-0.211225.0-cp37-cp37m-manylinux2010_x86_64.whl
| Download URL | hoshrust-0.211225.0-cp37-cp37m-manylinux2010_x86_64.whl |
|---|---|
| Size | 559.6 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
4ab0abb0ec33bff39c53169a8d577482ed2348f0a20f776ddc1d3c72f638d3e7
|
|
BLAKE2b-256 checksum How to use checksums |
461ea9e057cf92928a32b2909d0c99721b84e4877589c4103dc0cf67877e7705
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Release files / hoshrust-0.211225.0-cp37-cp37m-manylinux1_x86_64.whl
| Download URL | hoshrust-0.211225.0-cp37-cp37m-manylinux1_x86_64.whl |
|---|---|
| Size | 559.6 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
0ddb909de643bd906a4b22d0681c07c1bbe2a035e622640d22bb1047339746ff
|
|
BLAKE2b-256 checksum How to use checksums |
19900b2325f147b6541cb7fc377a560878d39500bfac206a7da0100fbbb7925b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Release files / hoshrust-0.211225.0-cp36-cp36m-manylinux2010_x86_64.whl
| Download URL | hoshrust-0.211225.0-cp36-cp36m-manylinux2010_x86_64.whl |
|---|---|
| Size | 559.6 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
ad73216c60d0a07183b6fb9deedfedc0f7ccb36fc284ad03360b1209618bcb6d
|
|
BLAKE2b-256 checksum How to use checksums |
1e4e038468d540d0a50fe2437e16873ed20bfdfc0286ac34e80799b72d4cbd13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Release files / hoshrust-0.211225.0-cp36-cp36m-manylinux1_x86_64.whl
| Download URL | hoshrust-0.211225.0-cp36-cp36m-manylinux1_x86_64.whl |
|---|---|
| Size | 559.6 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
5b6b2b410603904caf71b31962d6390fa41fae6a51fc1dce3ed91c6b21925775
|
|
BLAKE2b-256 checksum How to use checksums |
fa23fd902f46c024273911b395c39ef0ed15d4045a7c4473a4b9d3c311f19a1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|