Skip to main content

333

English | 中文

字节、字符串与文件哈希,附带低成本的文件比对。

安装

pip install 333

用法

from p333 import compare_files, hash_bytes, hash_file

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

说明

包名以数字开头,导入名是 p333。支持 blake2b(默认,最快)、sha256、sha1、md5;文件按块流式读取。compare_files 先比大小,大小不同一个 stat 就返回,不读内容。

许可证

MIT


English

Hashing for files and bytes across several algorithms.

Install

pip install 333

Usage

from p333 import compare_files, hash_bytes, hash_file

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

Notes

The distribution name starts with a digit, so the import name is p333. Algorithms: blake2b (default, fastest), sha256, sha1, md5. compare_files compares sizes first, so unequal files cost one stat instead of two full reads.

License

MIT

Metadata

Release files for 333 0.0.4

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.4
File Size Uploaded Provenance
333-0.0.4.tar.gz 3.5 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 7.2 kB

Release files / 333-0.0.4.tar.gz

Download URL 333-0.0.4.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
08ee68e03f9e51139b94a14fa5230d9556b28fcbb1084100ae0e1c9b95609d36
BLAKE2b-256 checksum
How to use checksums
f6f52599e101412a5712b882f69da71545e7fcf63f6b9c057f40ff97ea30a55b
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.4-py3-none-any.whl

Download URL 333-0.0.4-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a69064e82614a85e4e9be4545190a98c9e9713cd8ddd29b44d1b49fc3ee5e864
BLAKE2b-256 checksum
How to use checksums
302ca1ac07cadbaad1967039f8d21fdc668b4da0b77af99287332fb4ea5abdcc
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.4

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