Metadata-Version: 2.4
Name: altrepo-hash
Version: 0.1.1
Summary: A lightweight Python utility library for generating hashes and verifying checksums for text, bytes, and files.
Author-email: AltRepo <contact@altrepo.net>
Project-URL: Homepage, https://altrepo.net
Project-URL: Browser Text Hash Generator, https://altrepo.net/hash/text-hash-generator.html
Project-URL: More Hash Tools, https://altrepo.net/hash/
Project-URL: Repository, https://github.com/AltRepoYT/altrepo-hash
Project-URL: Issues, https://github.com/AltRepoYT/altrepo-hash/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: test
Requires-Dist: pytest>=7.0; extra == "test"
Dynamic: license-file

# altrepo-hash

AltRepo Hash is a lightweight Python utility library for generating hashes and verifying checksums for text, bytes, and files.

## Features

- **Straightforward API:** Easily generate hashes or verify checksums with a clean, intuitive interface.
- **Zero Dependencies:** Built entirely on top of Python's standard library, ensuring a lightweight footprint with no external requirements.
- **Secure Verifications:** Utilizes constant-time comparisons (`hmac.compare_digest`) to securely verify file and text hashes.
- **Broad Algorithm Support:** Includes built-in support for all major hashing algorithms including `sha256`, `sha512`, `sha3_256`, `blake2b`, `blake2s`, `md5`, `sha1`, and more.
- **Memory Efficient:** Safely processes large files in chunks via `hash_file` without loading the entire file into memory.

## Example API

```python
from altrepo_hash import hash_text, hash_file, verify_file_hash

print(hash_text("hello", algorithm="sha256"))

print(hash_file("download.zip", algorithm="sha256"))

print(
    verify_file_hash(
        "download.zip",
        expected_hash="abc123...",
        algorithm="sha256"
    )
)
```

## Browser Version

AltRepo Hash is the Python companion to the browser-based hash tools on AltRepo.

More hash tools:
https://altrepo.net/hash/
