1.2.0 • Published 4 years ago

qrcode-wasm v1.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

qrcode-wasm

DEMO

Web Assembly Qrcode generator

Usage

import { QrCodeWasm } from 'qrcode-wasm';

const generator = new QrCodeWasm({ debug: true });

generator.encode('HELLO WORLD').then(async (buffer) => {
	// buffer = Int32Array
	// [Side size of Matrix (total size = Side Size * Side Size), 1, 0, 1, 0, 0 ....]
	// 1 = Dark Module
	// 0 = White Module

	const dataURL = await generator.png(200 /* PNG size in Pixel */);
});

Webpack

If you want to use this package with webpack you must include the main.wasm file in your build output. You can customize the name or path to this file with the wasmPath option.

const generator = new QrCodeWasm({ wasmPath: 'scripts/custom.wasm' });

Errors

CODEDESCRIPTION
ERR_ENCMessage encoding not supported
ERR_TLONGMessage is too long

Build with

Typescript

Assemblyscript

1.2.0

4 years ago

1.1.0

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.0

4 years ago