Download the PHP package st-all-one/blake3 without Composer

On this page you can find all versions of the php package st-all-one/blake3. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package blake3

BLAKE3 for PHP

Pure PHP 8.4 implementation of BLAKE3: fast, deterministic, framework-agnostic, and dependency-free at runtime.

Requirements

Installation

The package is a library and exposes:

Symbol Purpose
StAllOne\Blake3\Hasher incremental hasher and static factories
StAllOne\Blake3\blake3_hash() one-shot hash
StAllOne\Blake3\blake3_keyed_hash() keyed hash (MAC/PRF)
StAllOne\Blake3\blake3_derive_key() key derivation from a context

Import the function explicitly; there is no global blake3_hash to avoid a fatal redeclaration when ext-blake3 is loaded:

API

blake3_hash(string $data, int $length = 32, bool $rawOutput = false): string

Hashes $data. $length is the number of output bytes and must be at least 1. Returns lowercase hexadecimal by default, or raw bytes when $rawOutput is true.

blake3_keyed_hash(string $key, string $data, int $length = 32, bool $rawOutput = false): string

Keyed BLAKE3. $key must be exactly 32 bytes. Use it for MAC/PRF-style constructions where both sides share a secret key.

blake3_derive_key(string $context, string $keyMaterial, int $length = 32, bool $rawOutput = false): string

Derives key material from a globally unique, application-specific $context and the input $keyMaterial. Different contexts derive independent keys.

Hasher

finalize() does not mutate the hasher. It can be called repeatedly, and update() may continue afterwards; the result is the hash of all bytes fed so far.

Invalid key length throws InvalidArgumentException; an output length below 1 throws ValueError.

Security notes

Testing and quality gates

Everything runs inside the two pinned images:

Base Image
glibc (Debian trixie) php:8.4.27-fpm-trixie@sha256:af172814…ff149c2
musl (Alpine 3.24) php:8.4.27-fpm-alpine3.24@sha256:93aa3f61…5076c00d

The test suite covers all 35 official vectors in the three modes (hash, keyed, derive) at 131-byte XOF, plus chunk/block boundaries, streaming splits, XOF prefixes, error paths, and state reuse.

Releasing

Releases are tag-driven and use .github/workflows/release.yml.

  1. Commit and merge the release changes to main, then confirm make check is green.
  2. Update CHANGELOG.md so the first version heading is exactly ## [X.Y.Z] - YYYY-MM-DD.
  3. Create and push an annotated tag:

The workflow rejects lightweight tags, tags not reachable from main, and tags whose version does not match the first changelog entry. It then runs make check, make smoke and make audit on both pinned images, creates .tar.gz/.zip source archives plus SHA256SUMS, and publishes a GitHub Release. A version containing - is marked as a prerelease. Packagist picks up the tag when the repository integration is configured.

Never move or delete a published release tag; publish a new patch version instead.

Performance

This is scalar PHP; there is no SIMD. The benchmark harness measures one-shot hash, keyed hash, derive-key, streaming, and XOF on both libc variants:

Baseline on the pinned images (PHP 8.4.27, x86_64, PCOV/assertions off, OPcache CLI off): 1 MiB hash ≈ 102–113 ms (≈ 8.9–9.8 MiB/s); 1 KiB hash ≈ 9.4–10.2 MiB/s. The optimized compressor is ~2.2–3.2× faster than the initial array-based implementation across small, large and sequential scenarios; see the A/B table in BENCHMARKS.md. glibc and musl are within measurement noise for this workload.

Results are recorded in BENCHMARKS.md. Treat them as a baseline for optimization on the same machine, not as a universal throughput claim. PCOV and assertions are disabled for benchmark runs (-d pcov.enabled=0 -d zend.assertions=-1); OPcache CLI and JIT are off unless explicitly enabled.

For production, keep OPcache enabled and preload vendor/autoload.php, src/Hasher.php and src/functions.php. Do not enable JIT for this workload without measuring: CLI tracing was slower than the interpreter here, and the result is deployment-specific.

Design constraints

See AGENTS.md for project rules.

License

Apache-2.0. The BLAKE3 test vectors are from the official BLAKE3 repository and retain their original licensing; see tests/fixtures/README.md.


All versions of blake3 with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
php-64bit Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package st-all-one/blake3 contains the following files

Loading the files please wait ...