quadqr-js 1.3.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FORMAT.md +13 -11
- package/README.md +84 -48
- package/SPECIFICATION.md +34 -19
- package/bin/quadqr.js +4 -2
- package/dist/camera-scanner-worker.js +793 -0
- package/dist/esm/benchmark.js +37 -6
- package/dist/esm/brotli.js +2210 -0
- package/dist/esm/camera-scanner-worker.js +793 -0
- package/dist/esm/deflate.js +381 -0
- package/dist/esm/geometry.js +25 -10
- package/dist/esm/quadqr.js +1904 -191
- package/dist/esm/security.js +19 -0
- package/dist/esm/vision.js +1118 -175
- package/dist/esm/wasm.js +85 -12
- package/dist/quadqr.js +5728 -408
- package/dist/quadqr.min.js +5621 -430
- package/dist/wasm/quadqr-core.wasm +0 -0
- package/docs/API.md +54 -15
- package/docs/BROWSER_CDN.md +10 -6
- package/docs/CLI.md +167 -156
- package/docs/COMPRESSION.md +170 -0
- package/docs/GETTING_STARTED.md +12 -2
- package/docs/HIGH_DENSITY_MODE.md +100 -100
- package/docs/NODE.md +159 -137
- package/docs/README.md +62 -60
- package/docs/RELIABILITY_LAB.md +64 -0
- package/docs/TRIANGLE16.md +98 -108
- package/docs/WASM.md +30 -4
- package/package.json +12 -11
- package/types/benchmark.d.ts +0 -8
- package/types/index.d.ts +0 -403
- package/types/node.d.ts +0 -11
package/bin/quadqr.js
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import { savePNG, saveSVG, scanFile } from "../dist/node.js";
|
|
16
16
|
|
|
17
17
|
function help() {
|
|
18
|
-
console.log(`QuadQR CLI\n\nUsage:\n quadqr encode <text> [-o file.png|file.svg] [--ecc M] [--version auto|1..40] [--high-density]\n quadqr encode <text> [--compression auto]\n quadqr encode <text> --sign-key signing-key.json [--key-id issuer-main]\n quadqr encode <text> --password <password> [-o file.png|file.svg]\n quadqr decode <file.png> [--password <password> | --key <64-hex-key>] [--verify-key signing-key.json] [--debug]\n quadqr keygen\n quadqr signkeygen [-o signing-key.json]\n\nOptions:\n -o, --output <file> Output PNG/SVG path, or signing-key JSON for signkeygen\n --ecc <L|M|Q|H> ECC profile (default: M)\n --version <auto|1..40> Symbol version (default: auto)\n --compression <mode> none|auto|lz (default: auto)\n --high-density Enable experimental Triangle16 High Density Mode\n --sign-key <file> Sign using a signkeygen JSON bundle\n --key-id <id> Override the signing key ID stored in the QuadQR\n --embed-public-key Also embed the public key for untrusted/self-contained checks\n --verify-key <file> Verify a signed QuadQR with a trusted key bundle\n --password <text> Encrypt/decrypt with password mode\n --key <hex> Encrypt/decrypt with raw 256-bit key mode\n --print Use the print-safe render profile\n --image-size <px> Exact square output size (default: 720)\n --module-size <px> Legacy pixels-per-module sizing\n --quiet-zone <modules> Quiet zone in modules (default: 4)\n --debug Emit scanner diagnostics to stderr on decode\n -h, --help Show help\n`);
|
|
18
|
+
console.log(`QuadQR CLI\n\nUsage:\n quadqr encode <text> [-o file.png|file.svg] [--ecc M] [--version auto|1..40] [--high-density]\n quadqr encode <text> [--compression auto]\n quadqr encode <text> --sign-key signing-key.json [--key-id issuer-main]\n quadqr encode <text> --password <password> [-o file.png|file.svg]\n quadqr decode <file.png> [--password <password> | --key <64-hex-key>] [--verify-key signing-key.json] [--debug]\n quadqr keygen\n quadqr signkeygen [-o signing-key.json]\n\nOptions:\n -o, --output <file> Output PNG/SVG path, or signing-key JSON for signkeygen\n --ecc <L|M|Q|H> ECC profile (default: M)\n --version <auto|1..40> Symbol version (default: auto)\n --compression <mode> none|auto|smart|brotli|deflate|lz (default: auto)\n --compression-level <n> Explicit LZ/DEFLATE 1..9 or Brotli 0..11 level\n --high-density Enable experimental Triangle16 High Density Mode\n --sign-key <file> Sign using a signkeygen JSON bundle\n --key-id <id> Override the signing key ID stored in the QuadQR\n --embed-public-key Also embed the public key for untrusted/self-contained checks\n --verify-key <file> Verify a signed QuadQR with a trusted key bundle\n --password <text> Encrypt/decrypt with password mode\n --key <hex> Encrypt/decrypt with raw 256-bit key mode\n --print Use the print-safe render profile\n --image-size <px> Exact square output size (default: 720)\n --module-size <px> Legacy pixels-per-module sizing\n --quiet-zone <modules> Quiet zone in modules (default: 4)\n --debug Emit scanner diagnostics to stderr on decode\n -h, --help Show help\n`);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
function parse(argv) {
|
|
@@ -31,6 +31,7 @@ function parse(argv) {
|
|
|
31
31
|
else if (token === "--password") flags.password = argv[++i];
|
|
32
32
|
else if (token === "--key") flags.key = argv[++i];
|
|
33
33
|
else if (token === "--compression") flags.compression = argv[++i];
|
|
34
|
+
else if (token === "--compression-level") flags.compressionLevel = Number(argv[++i]);
|
|
34
35
|
else if (token === "--sign-key") flags.signKey = argv[++i];
|
|
35
36
|
else if (token === "--key-id") flags.keyId = argv[++i];
|
|
36
37
|
else if (token === "--embed-public-key") flags.embedPublicKey = true;
|
|
@@ -104,6 +105,7 @@ async function main() {
|
|
|
104
105
|
ecc: flags.ecc || "M",
|
|
105
106
|
highDensity: Boolean(flags.highDensity),
|
|
106
107
|
compression: flags.compression || "auto",
|
|
108
|
+
...(Number.isFinite(flags.compressionLevel) ? { compressionLevel: flags.compressionLevel } : {}),
|
|
107
109
|
...(flags.version && flags.version !== "auto" ? { version: Number(flags.version) } : {})
|
|
108
110
|
};
|
|
109
111
|
const signingBundle = flags.signKey ? await readSigningBundle(flags.signKey) : null;
|
|
@@ -140,7 +142,7 @@ async function main() {
|
|
|
140
142
|
const saved = output.toLowerCase().endsWith(".svg")
|
|
141
143
|
? await saveSVG(code, output, renderOptions)
|
|
142
144
|
: await savePNG(code, output, renderOptions);
|
|
143
|
-
console.log(`Saved ${output} (${saved.bytes} bytes, v${code.version}, ${code.size}x${code.size}, ${code.highDensity ? "High Density experimental" : "Normal RGBW"}, ECC ${code.eccLevel}).`);
|
|
145
|
+
console.log(`Saved ${output} (${saved.bytes} bytes, v${code.version}, ${code.size}x${code.size}, ${code.highDensity ? "High Density experimental" : "Normal RGBW"}, ECC ${code.eccLevel}${code.compressed ? `, ${code.compression}${code.compressionLevel != null ? ` level ${code.compressionLevel}` : ""}` : ""}).`);
|
|
144
146
|
return;
|
|
145
147
|
}
|
|
146
148
|
|