Metadata-Version: 2.4
Name: turboblake
Version: 1.8.8
Summary: BLAKE3, with big inputs hashed on every core by a Bend2 engine: a drop-in for the blake3 module
License-Expression: CC0-1.0 OR Apache-2.0 OR Apache-2.0 WITH LLVM-exception
Project-URL: Homepage, https://gunta.github.io/turboblake/
Project-URL: Repository, https://github.com/gunta/turboblake
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: C
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE_A2
License-File: LICENSE_A2LLVM
License-File: LICENSE_CC0
Dynamic: license-file

# turboblake (Python)

The `blake3` module, API-compatible with the Rust-based
[`blake3`](https://pypi.org/project/blake3/) on PyPI, built on
libturboblake: the official BLAKE3 C library whose big inputs are hashed on
every core by a [Bend2](https://bend-lang.com) engine. blake3-py's own test
suite passes.

```bash
pip uninstall blake3 && pip install turboblake
```

Wheels come with the engine built in for macOS and Linux (glibc 2.28+ and
musl) on arm64 and x86-64, for every CPython from 3.9; the x86-64 ones take
AVX2 where the CPU has it and run on any x86-64 CPU. On Windows, where the
engine does not run yet, `pip install turboblake` installs the official
`blake3` package instead, so `import blake3` is never slower than upstream's.
Anywhere else pip builds from the sdist with clang; without clang it
installs the official `blake3` too.

```python
from blake3 import blake3

blake3(b"hello world").hexdigest()
blake3(data, key=key).digest(length=64, seek=0)
hasher = blake3(derive_key_context="example.com 2026-10-26 session keys")
hasher.update_mmap("big.iso")
```

GPU memory is hashed where it is (ADR 0017), on CUDA or Metal:

```python
import blake3, torch

t = torch.load("weights.pt", map_location="cuda")
h = blake3.blake3()
h.update_cuda(t.data_ptr(), t.numel() * t.element_size())   # stream=0
h.hexdigest()
blake3.gpu()                                                   # 'cuda', 'metal' or None
```

Your code keeps `from blake3 import blake3`. `max_threads` is accepted and
ignored, as the upstream docs allow: the engine takes any update big enough
to beat the trip to it, on every core. Building from source needs a C
compiler, and clang for the engine (set `CC=clang` if gcc is the default);
without clang it builds on the official C alone.

The extension is blake3-py's C implementation (`c_impl/blake3module.c`, by
Jack O'Connor, CC0-1.0 OR Apache-2.0), with `update_mmap` mapping the file.
Its tests (`tests/`) are blake3-py's.

License: CC0-1.0 OR Apache-2.0 OR Apache-2.0 WITH LLVM-exception, as
BLAKE3. The engine contains the Bend2 runtime, Apache-2.0.
