
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
@nuintun/qrcode
Advanced tools
A pure JavaScript QRCode encode and decode library.
Modify from kazuhikoarase/qrcode-generator and cozmo/jsQR
import { Encoder, QRByte, QRKanji, ErrorCorrectionLevel } from '@nuintun/qrcode';
const qrcode = new Encoder();
qrcode.setEncodingHint(true);
qrcode.setErrorCorrectionLevel(ErrorCorrectionLevel.H);
qrcode.write('你好世界\n');
qrcode.write(new QRByte('hello world\n'));
qrcode.write(new QRKanji('こんにちは世界'));
qrcode.make();
console.log(qrcode.toDataURL());
new Encoder(options?: Options): Encoder
getMatrix(): boolean[][]
getMatrixSize(): number
setVersion(version: number): Encoder
0
the version will be set automatically.getVersion(): number
setErrorCorrectionLevel(errorCorrectionLevel: ErrorCorrectionLevel): Encoder
getErrorCorrectionLevel(): ErrorCorrectionLevel
setEncodingHint(encodingHint: boolean): Encoder
getEncodingHint(): boolean
write(data: string | QRByte | QRKanji | QRNumeric | QRAlphanumeric): Encoder
QRByte
by default.isDark(row: number, col: number): boolean
make(): Encoder
toDataURL(moduleSize?: number, margin?: number): string
clear(): void
import { Encoder, QRByte } from '@nuintun/qrcode';
const qrcode = new Encoder();
qrcode.setEncodingHint(true);
// Custom your own encode function return bytes and encoding
// The encoding value must a valid ECI value
// Custom ECI only support QRByte mode
// https://github.com/zxing/zxing/blob/master/core/src/main/java/com/google/zxing/common/CharacterSetECI.java
qrcode.write(
new QRByte('hello world', data => ({
encoding: 26,
bytes: [104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]
}))
);
qrcode.make();
console.log(qrcode.toDataURL());
import { Decoder } from '@nuintun/qrcode';
const qrcode = new Decoder();
qrcode
.scan('https://nuintun.github.io/qrcode/examples/qrcode.jpg')
.then(result => {
console.log(result.data);
})
.catch(error => {
console.error(error);
});
new Decoder(options?: Options): Decoder
setOptions(options: Options): Decoder
scan(src: string): Promise<DecoderResult>
Notice: support browser environment only.
decode(data: Uint8ClampedArray, width: number, height: number): DecoderResult
FAQs
A pure JavaScript QRCode encode and decode library.
We found that @nuintun/qrcode demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.