Metadata-Version: 2.5
Name: 333
Version: 0.0.2
Summary: Hashing for files and bytes across several algorithms.
Project-URL: Homepage, https://github.com/lqxnjk/333
Author: lqxnjk
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

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

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

```python
from p333 import hash_file
```

## Install

```console
pip install 333
```

## Usage

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