hosh
Fast cryptographic hash (half-blake3) and operators for Rust and Python.
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}")
"""
0Sux8dX5O3gkPx5KkGKYKP * 0Q7q8pNuFRZwoBBzM1RYiq = 0EHzVjd9q7pK4AmiZlCffL
"""
# Multiplication can be reverted by the inverse hash. Zero is the identity hash.
print(f"{b} * {~b} = {b * ~b} = 0")
"""
0Q7q8pNuFRZwoBBzM1RYiq * 3TW3af8GIVKzzojLZbBqq5 = 0000000000000000000000 = 0
"""
print(f"{c} * {~b} = {c * ~b} = {a} = a")
"""
0EHzVjd9q7pK4AmiZlCffL * 3TW3af8GIVKzzojLZbBqq5 = 0Sux8dX5O3gkPx5KkGKYKP = 0Sux8dX5O3gkPx5KkGKYKP = a
"""
print(f"{~a} * {c} = {~a * c} = {b} = b")
"""
6Ms8EdXd3yzeddcxefn5FF * 0EHzVjd9q7pK4AmiZlCffL = 0Q7q8pNuFRZwoBBzM1RYiq = 0Q7q8pNuFRZwoBBzM1RYiq = b
"""
# Division is shorthand for reversion.
print(f"{c} / {b} = {c / b} = a")
"""
0EHzVjd9q7pK4AmiZlCffL / 0Q7q8pNuFRZwoBBzM1RYiq = 0Sux8dX5O3gkPx5KkGKYKP = a
"""
# Hash multiplication is not expected to be commutative.
print(f"{a * b} != {b * a}")
"""
0EHzVjd9q7pK4AmiZlCffL != 3qXz8PSpGGugRb0jP9BEzd
"""
# Hash multiplication is associative.
print(f"{a * (b * c)} = {(a * b) * c}")
"""
2xWdrj6rCfITvCfiU31v96 = 2xWdrj6rCfITvCfiU31v96
"""
Features
Metadata
Release files for hosh 0.2103.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hosh-0.2103.1.tar.gz | 24.8 kB | Without provenance | Details for hosh-0.2103.1.tar.gz |
Built distributions (wheels)
Total release size: 4.4 MB
Release files / hosh-0.2103.1.tar.gz
| Download URL | hosh-0.2103.1.tar.gz |
|---|---|
| Size | 24.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a8ebdc0c6ea420aa7208ca14bbce4a5762005e0a4c7d008948b1e3b9df9845e5
|
|
BLAKE2b-256 checksum How to use checksums |
a91e2608210dabe73de0c1e4c88eca68391ede7d0126e2a2165f8d80e7622ae1
|
| 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.1-cp39-cp39-manylinux2010_x86_64.whl
| Download URL | hosh-0.2103.1-cp39-cp39-manylinux2010_x86_64.whl |
|---|---|
| Size | 553.1 kB |
| Tags | CPython 3.9 Linux glibc 2.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
11f8970e6b39ba59d5ffff417531bb1fff8a6627d95583934588c1288136ddea
|
|
BLAKE2b-256 checksum How to use checksums |
d39ed7c1500925f265d633d04c44bd921d1c1b3379bfbd35623956a3b66f7806
|
| 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.1-cp39-cp39-manylinux1_x86_64.whl
| Download URL | hosh-0.2103.1-cp39-cp39-manylinux1_x86_64.whl |
|---|---|
| Size | 553.1 kB |
| Tags | CPython 3.9 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
a485a174076afc8fac8eb949e2f3ccce5bcffc556e6f007aa1c507ee3a1f7140
|
|
BLAKE2b-256 checksum How to use checksums |
088da47cdfba41147962d9427563db329bc09b0af15c6776a52b19ac748fa602
|
| 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.1-cp38-cp38-manylinux2010_x86_64.whl
| Download URL | hosh-0.2103.1-cp38-cp38-manylinux2010_x86_64.whl |
|---|---|
| Size | 553.1 kB |
| Tags | CPython 3.8 Linux glibc 2.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
3c2e8f893ac6415ba777c27c54033f04dd5174446232f8d05642e6cdde9877e2
|
|
BLAKE2b-256 checksum How to use checksums |
4d92ed5e4687cfb18ee96026a1bef634419d08e0cfbfacb9ed517305ed50b977
|
| 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.1-cp38-cp38-manylinux1_x86_64.whl
| Download URL | hosh-0.2103.1-cp38-cp38-manylinux1_x86_64.whl |
|---|---|
| Size | 553.1 kB |
| Tags | CPython 3.8 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
391fcc45ea8165f11dfaa7e234968b05f040ca2934bd81a4edf5409b3c13ad41
|
|
BLAKE2b-256 checksum How to use checksums |
b78e08218724b3d0d5a5e25e23ed6ec6a8a4c6592f84ef9e772abad7a8b7399c
|
| 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.1-cp37-cp37m-manylinux2010_x86_64.whl
| Download URL | hosh-0.2103.1-cp37-cp37m-manylinux2010_x86_64.whl |
|---|---|
| Size | 553.1 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
df6479e1a3d4a3fd1ce852e96e60fb92e34dbcfb43ec6d7028219b98eb5a0bef
|
|
BLAKE2b-256 checksum How to use checksums |
9883fd7c1976b8acfb9a1eadd6bd612f43063ad1bd4847b03708421b05c32a9c
|
| 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.1-cp37-cp37m-manylinux1_x86_64.whl
| Download URL | hosh-0.2103.1-cp37-cp37m-manylinux1_x86_64.whl |
|---|---|
| Size | 553.1 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
c9fcc6d49320ab6bcb08fb392100647abd672ac23a64ebf587fc9173c4485e78
|
|
BLAKE2b-256 checksum How to use checksums |
31ac943f0d9ef423e9340cb04b6618f73332b1137951943ae349ee3634b20436
|
| 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.1-cp36-cp36m-manylinux2010_x86_64.whl
| Download URL | hosh-0.2103.1-cp36-cp36m-manylinux2010_x86_64.whl |
|---|---|
| Size | 553.1 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
df36f668a692aaa70bd2218ca3f838c3b416f59042ace9453760bbf8d7739316
|
|
BLAKE2b-256 checksum How to use checksums |
ac5392a6f5c36c2bd7e557fb348d32129099fce438b829f9ca90f4fb11a47dc6
|
| 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.1-cp36-cp36m-manylinux1_x86_64.whl
| Download URL | hosh-0.2103.1-cp36-cp36m-manylinux1_x86_64.whl |
|---|---|
| Size | 553.1 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
43c6a0fda1fa01c925a6a2186c1fbcec85c1b4e9350ae9c1c7708a99ed2fa59e
|
|
BLAKE2b-256 checksum How to use checksums |
9a53bdcef9c34e66ed2697aeb5b1b67863ca5a1db4fbb5669b0fad8f6b3ff62e
|
| 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.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.