Metadata-Version: 2.5
Name: 333
Version: 0.0.4
Summary: 字节、字符串与文件哈希，附带低成本的文件比对。
Project-URL: Homepage, https://pypi.org/project/333/
Author-email: lqxnjk <lqxnjk@qq.com>
License: MIT
License-File: LICENSE
Keywords: blake2b,checksum,digest,file,hash,sha256
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# 333

[English](#english) | 中文

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

## 安装

```console
pip install 333
```

## 用法

```python
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

---

<a id="english"></a>
## English

Hashing for files and bytes across several algorithms.

## Install

```console
pip install 333
```

## Usage

```python
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
