Skip to main content

test codecov

hosh

Fast cryptographic hash (half-blake3) and operators for Rust and Python.

Colored base-62 representation

Python installation

from package

# Set up a virtualenv. 
python3 -m venv venv
source venv/bin/activate

# Install from PyPI
pip install hosh

from source

cd my-project
git clone https://github.com/davips/hosh ../hosh
pip install -e ../hosh

Examples

Basic operations

from hosh 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 hosh 0.2103.2

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

Source distribution (sdist)

Source distribution for hosh 0.2103.2
File Size Uploaded Provenance Actions
hosh-0.2103.2.tar.gz 65.0 kB Without provenance Details for hosh-0.2103.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for hosh 0.2103.2
File Actions
hosh-0.2103.2-cp39-cp39-manylinux2010_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.12+ x86-64 Details for hosh-0.2103.2-cp39-cp39-manylinux2010_x86_64.whl
hosh-0.2103.2-cp39-cp39-manylinux1_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.5+ x86-64 Details for hosh-0.2103.2-cp39-cp39-manylinux1_x86_64.whl
hosh-0.2103.2-cp38-cp38-manylinux2010_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.12+ x86-64 Details for hosh-0.2103.2-cp38-cp38-manylinux2010_x86_64.whl
hosh-0.2103.2-cp38-cp38-manylinux1_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.5+ x86-64 Details for hosh-0.2103.2-cp38-cp38-manylinux1_x86_64.whl
hosh-0.2103.2-cp37-cp37m-manylinux2010_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64 Details for hosh-0.2103.2-cp37-cp37m-manylinux2010_x86_64.whl
hosh-0.2103.2-cp37-cp37m-manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details for hosh-0.2103.2-cp37-cp37m-manylinux1_x86_64.whl
hosh-0.2103.2-cp36-cp36m-manylinux2010_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64 Details for hosh-0.2103.2-cp36-cp36m-manylinux2010_x86_64.whl
hosh-0.2103.2-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details for hosh-0.2103.2-cp36-cp36m-manylinux1_x86_64.whl

Total release size: 4.5 MB

Release files / hosh-0.2103.2.tar.gz

Download URL hosh-0.2103.2.tar.gz
Size 65.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e173538d88291d12b072e9aa4b8c6a6aa56a22138d2b2fdaf0bce672e60f6b28
BLAKE2b-256 checksum
How to use checksums
4c5005ecd7168f496c76364970d49b863957a85da36eac1a0726c2d32e67a9ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

Release files / hosh-0.2103.2-cp39-cp39-manylinux2010_x86_64.whl

Download URL hosh-0.2103.2-cp39-cp39-manylinux2010_x86_64.whl
Size 555.0 kB
Tags CPython 3.9 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
a8ec05f2f3b3076967bee6a6a33a140cee322fd9c6dcfe16c0459dfa10477b0e
BLAKE2b-256 checksum
How to use checksums
5d2d0f008c6594b344d8590a7274f59c4b9f66b3f66e5e006776b37ffbf7ca65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

Release files / hosh-0.2103.2-cp39-cp39-manylinux1_x86_64.whl

Download URL hosh-0.2103.2-cp39-cp39-manylinux1_x86_64.whl
Size 555.0 kB
Tags CPython 3.9 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
1b19e832a9688dce8793883e446f3ea1db5723bc9aba7ddfd96546d66ab373f9
BLAKE2b-256 checksum
How to use checksums
840c65bbbd9b3c41ae85b3e531d5287cb710416002abd1602e84405ca506aedf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

Release files / hosh-0.2103.2-cp38-cp38-manylinux2010_x86_64.whl

Download URL hosh-0.2103.2-cp38-cp38-manylinux2010_x86_64.whl
Size 555.1 kB
Tags CPython 3.8 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
12e9b7d58389b1aa349f0c8f5d49a9ce17d827319d2ecebe0a76747ec1e5907a
BLAKE2b-256 checksum
How to use checksums
30cfd80a472c5bcbe9db58d49bd8c505f87befdaa3e1180ff70509a8fd915a1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

Release files / hosh-0.2103.2-cp38-cp38-manylinux1_x86_64.whl

Download URL hosh-0.2103.2-cp38-cp38-manylinux1_x86_64.whl
Size 555.1 kB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
11d2f40bbc4a59153ebdb542f5c90e4335d799822e61fd5d59de0681730e0921
BLAKE2b-256 checksum
How to use checksums
0c35fde013b052a2edb609389fedd21bf24d91b79925c8fccad157dd85ade61c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

Release files / hosh-0.2103.2-cp37-cp37m-manylinux2010_x86_64.whl

Download URL hosh-0.2103.2-cp37-cp37m-manylinux2010_x86_64.whl
Size 555.1 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
8cbbba2f3855bcea5487a66a8621828a878117402c892159d6b3356e4b5b2ee1
BLAKE2b-256 checksum
How to use checksums
f18ffb9abc2201d1fa5699af5ba8b8f1641c741563571f7efbb145cffc6d16b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

Release files / hosh-0.2103.2-cp37-cp37m-manylinux1_x86_64.whl

Download URL hosh-0.2103.2-cp37-cp37m-manylinux1_x86_64.whl
Size 555.1 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
7db0fb0fb1ed3023c4a43110669763e4b41f7cf7f744a640dddfc7e1b288465d
BLAKE2b-256 checksum
How to use checksums
4a64ca0b6919e42c026203705f1efa079ef5cc3ca7ba389c270a20440c1cd027
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

Release files / hosh-0.2103.2-cp36-cp36m-manylinux2010_x86_64.whl

Download URL hosh-0.2103.2-cp36-cp36m-manylinux2010_x86_64.whl
Size 555.2 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
48d3b944def5ac0f880ca2975e54beef3d61550188705619c350552cbe546dcc
BLAKE2b-256 checksum
How to use checksums
a98e443faba4688a88bb340c4b58947bfa8754a9542b2a6776433172230ad1bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

Release files / hosh-0.2103.2-cp36-cp36m-manylinux1_x86_64.whl

Download URL hosh-0.2103.2-cp36-cp36m-manylinux1_x86_64.whl
Size 555.2 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
74d0c135f559f4dbcbada5d7a72a7b7887ad79d8617726631cc7eb373997e53b
BLAKE2b-256 checksum
How to use checksums
e88164bc4ff631d50fe653c514202b5aecf42d31e93297bfbb551d1d4b217a25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

Security for hosh 0.2103.2

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