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.3
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 | |
|---|---|---|---|---|
| 333-0.0.3.tar.gz | 3.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 333-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.2 kB
Release files / 333-0.0.3.tar.gz
| Download URL | 333-0.0.3.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10e250767b5a18bf484cdaa55d58b1352f0d2f81cabb22978eb93f68526d6c61
|
|
BLAKE2b-256 checksum How to use checksums |
dde2c77cc317f50bc81a878517e1ac41ec54e8092f2e67930f2808ce7f7de538
|
| 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.3-py3-none-any.whl
| Download URL | 333-0.0.3-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
30840a4731c24c3307677c7ae66a13a04c99655dbeb9de35a3561c02a9404b6c
|
|
BLAKE2b-256 checksum How to use checksums |
2a8956a579391724c2caf43457d4cd6e304a574bcc627523f2def2adcb1ba9b5
|
| 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.3
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.