crazy-goat/qrcode-ext

Native PHP extension backing crazy-goat/scanmephp — the C++ QR encoder behind NativeEncoder

Maintainers

Package info

github.com/crazy-goat/qrcode-ext

Homepage

Language:C++

Type:php-ext

Ext name:ext-scanmeqr

pkg:composer/crazy-goat/qrcode-ext

Transparency log

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.5.2 2026-08-26 04:31 UTC

This package is auto-updated.

Last update: 2026-08-26 04:31:36 UTC


README

The native QR encoder behind ScanMePHP, installable with PIE. Extension version 0.5.2.

This repository is generated. The sources live in crazy-goat/ScanMePHP under php-ext/ and clib/, and every release overwrites this mirror with a single commit — issues and pull requests belong there.

Installing

composer require crazy-goat/scanmephp
pie install crazy-goat/qrcode-ext

Both halves are needed. The extension exposes a single internal class, CrazyGoat\ScanMePHP\NativeEncoderCore, and its encodeMatrix() builds a CrazyGoat\ScanMePHP\Matrix — so without the library loaded it can only throw. The library in turn detects the extension and routes NativeEncoder through it automatically; with neither the extension nor an FFI binary present it falls back to the pure-PHP encoder, so installation is an optimisation and never a requirement.

Building needs a C++20 compiler (GCC 10+ / Clang 12+) and takes a few seconds. There is nothing else to install: the C++ core is compiled into the extension rather than linked against a separate shared library.

What you get

The encoder runs about 10× faster than the pure-PHP path. On x86-64 the mask-penalty pass is built three times over — a portable kernel plus AVX2 and AVX-512 variants — and the right one is chosen at load time from the CPU's own feature bits, so one binary stays correct on any machine that can run it. arm64 gets the portable kernel, which the compiler vectorises to NEON.

Prebuilt binaries for the common platforms are attached to every ScanMePHP release if you would rather not compile at all.

MIT.