Skip to main content

333

Hash bytes, strings and files — and compare two files cheaply.

The import name is p333 because a Python module cannot start with a digit:

from p333 import hash_file

Install

pip install 333

Usage

from p333 import compare_files, hash_bytes, hash_file

hash_bytes("abc")                       # blake2b hex digest
hash_bytes(b"abc", n_algo="sha256")
hash_file("big.iso")                    # streamed, 1 MiB blocks
hash_file("big.iso", n_algo="md5", n_chunk=4 << 20)
compare_files("a.bin", "b.bin")         # True / False

Algorithms

blake2b (default, fastest), sha256, sha1, md5.

An unknown algorithm raises ValueError rather than falling back to a default.

Why compare_files is cheaper

Identical content implies identical size, so a size mismatch returns False after one stat per file — no reading at all.

License

MIT

Metadata

Release files for 333 0.0.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 333 0.0.2
File Size Uploaded Provenance
333-0.0.2.tar.gz 3.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for 333 0.0.2
File Interpreter ABI Platform
333-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 6.6 kB

Release files / 333-0.0.2.tar.gz

Download URL 333-0.0.2.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
90358cf6eb534f20c79c1109e98d2b577b874c5895ba12b2794b180773c9f533
BLAKE2b-256 checksum
How to use checksums
3f1eef60d451ab094a8fda1d8f99b864def3f694210106bbe59dc084ba6bbd82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Release files / 333-0.0.2-py3-none-any.whl

Download URL 333-0.0.2-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23f59286d157c14813515e3edc26f16eff4a380cdf62ddb88bd3ebbf057d2e37
BLAKE2b-256 checksum
How to use checksums
4a521faacd3ada2574c20a449fed3d5e10efda5d10f264690b9fbe69de2205c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Security for 333 0.0.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