qr

A native QR code generator for EZ utilizing libqrencode via FFI.

qrqrcodeffi 0 downloads owners: imabd645

Install

ez install qr

Dependencies (1.0.0)

PackageRange
No dependencies.

Readme

qr

qr is a fast, native QR code generator library for EZ. It operates seamlessly by wrapping the C libqrencode library through EZ's native Foreign Function Interface (FFI).

Requirements

You must have the qrencode library installed on your system.
On Windows with MSYS2, run:

pacman -S mingw-w64-x86_64-qrencode

Quick Start

use "qr" as qrlib

# Create a QR code from text
# The second parameter is Error Correction Level:
# 0 = L, 1 = M, 2 = Q, 3 = H
qr = qrlib.QRCode("https://github.com/ez-lang/ez", 0)

# Render it directly to the terminal!
out qr.toAscii()

API Reference

model QRCode

init(text, errorLevel)

Constructs a new QRCode containing the specified data.

If errorLevel is omitted, it defaults to 0.

toMatrix()

Extracts the raw 2D array representation of the QR code.

toAscii()

Generates an optimized string representation of the QR code for terminal output using UTF-8 half-block characters.

saveImage(filepath, scale)

Saves the generated QR code to disk as a high-quality, uncompressed 24-bit Bitmap (BMP) image. It uses FFI to write the binary file entirely natively without requiring any external image processing libraries.

Versions

VersionSizeDownloadsPublished
1.0.0 27.0 KB 0 1 hour ago

Integrity

sha256  7f0bab7ebc6d6ac8427c74457c6c8548f858662169f8b15317fe66725bfa0804