Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@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());
getModules(): boolean[][]
getModuleCount(): number
setVersion(version: number): Encoder
0
the version will be set automatically.getVersion(): number
setErrorCorrectionLevel(errorCorrectionLevel: ErrorCorrectionLevel): Encoder
getErrorCorrectionLevel(): ErrorCorrectionLevel
setEncodingHint(hasEncodingHint: 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
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);
});
setOptions(options: Optins): 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.
The npm package @nuintun/qrcode receives a total of 21,938 weekly downloads. As such, @nuintun/qrcode popularity was classified as popular.
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 0 open source maintainers 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.