Metadata-Version: 2.4
Name: fast-hashes
Version: 0.1.0
Summary: Lightweight, fast hashing utilities wrapping hashlib with BLAKE2 support
Home-page: https://github.com/nickolasburr/fast-hashes
Author: Nicolas Burr
Author-email: nburr@proton.me
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: colorama>=0.4
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# fast-hashes

> Lightweight, zero-dependency\* hashing utilities for Python — wrapping `hashlib` with a clean API and BLAKE2b support.

\*Only `colorama` for pretty terminal output on non-Linux platforms.

[![PyPI](https://img.shields.io/pypi/v/fast-hashes)](https://pypi.org/project/fast-hashes/)
[![Python](https://img.shields.io/pypi/pyversions/fast-hashes)](https://pypi.org/project/fast-hashes/)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)

## Installation

```bash
pip install fast-hashes
```

> **Note:** Native optimized bindings are available on **Linux only** (Ubuntu 20.04+, Debian 11+, Fedora 38+).
> On other platforms the library falls back to pure-Python hashlib wrappers.

## Quick Start

```python
from fast_hashes import sha256, md5, blake2

# String input
print(sha256("hello world"))
# → b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9

# Bytes input
print(md5(b"binary data"))
# → 4c3c7c067634daec9716a80ea886d734

# BLAKE2b with custom digest size
print(blake2("fast!", digest_size=16))
# → 32-char hex string
```

## API Reference

| Function | Description | Returns |
|----------|-------------|---------|
| `md5(data)` | MD5 hex digest | `str` |
| `sha1(data)` | SHA-1 hex digest | `str` |
| `sha256(data)` | SHA-256 hex digest | `str` |
| `sha512(data)` | SHA-512 hex digest | `str` |
| `blake2(data, digest_size=32)` | BLAKE2b hex digest | `str` |

All functions accept `str` or `bytes`. Strings are automatically UTF-8 encoded.

## Supported Platforms

| Platform | Status |
|----------|--------|
| Ubuntu 20.04+ | ✅ Full support (native bindings) |
| Debian 11+ | ✅ Full support (native bindings) |
| Fedora 38+ | ✅ Full support (native bindings) |
| Arch Linux | ✅ Full support (native bindings) |
| macOS | ⚠️ Fallback (pure Python) |
| Windows | ⚠️ Fallback (pure Python) |

## Benchmarks

Compared to raw `hashlib` calls, `fast-hashes` adds negligible overhead (~2μs per call) while providing:

- Automatic string-to-bytes encoding
- Consistent hex output
- BLAKE2b with configurable digest size
- Platform compatibility checks

## License

MIT
