@sythos/js_barcode_universal 1.0.0 → 1.1.0

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/README.md CHANGED
@@ -90,8 +90,8 @@ const svg = toSVG(encodeQR('https://example.com', { ecc: 'M' }), { scale: 8 });
90
90
  | `@sythos/js_barcode_universal/core` | `BitMatrix`, `GaloisField`, Reed–Solomon, the error classes |
91
91
  | `@sythos/js_barcode_universal/image` | `LuminanceSource`, the binarizers, grid sampling, `PerspectiveTransform` |
92
92
  | `@sythos/js_barcode_universal/oned` | The per-format 1D writers (`encodeEAN13`, `encodeCode128`, …) and `decodeOneD` |
93
- | `@sythos/js_barcode_universal/qr` | `encodeQR`, `decodeQR`, `detectQR`, `detectAndDecodeQR` |
94
- | `@sythos/js_barcode_universal/datamatrix` | `encodeDataMatrix`, `decodeDataMatrix`, `detectDataMatrix`, `detectAndDecodeDataMatrix` |
93
+ | `@sythos/js_barcode_universal/qr` | `encodeQR`, `decodeQR`, `detectQR`, `detectAndDecodeQR` |
94
+ | `@sythos/js_barcode_universal/datamatrix` | `encodeDataMatrix`, `decodeDataMatrix`, `detectDataMatrix`, `detectAndDecodeDataMatrix` |
95
95
  | `@sythos/js_barcode_universal/render` | Every renderer plus `isWebGL2Available` / `isWebGPUAvailable` |
96
96
  | `@sythos/js_barcode_universal/render/svg` | `toSVG`, `toSVGDataURI` |
97
97
  | `@sythos/js_barcode_universal/render/png` | `toPNG`, `toPNGDataURI` |
@@ -103,8 +103,8 @@ The `unpkg` and `jsdelivr` fields point at the IIFE bundle, so a CDN needs no in
103
103
 
104
104
  ```html
105
105
  <script src="https://unpkg.com/@sythos/js_barcode_universal"></script>
106
- <script src="https://unpkg.com/@sythos/js_barcode_universal@1.0.0"></script>
107
- <script src="https://cdn.jsdelivr.net/npm/@sythos/js_barcode_universal@1.0.0"></script>
106
+ <script src="https://unpkg.com/@sythos/js_barcode_universal@1.1.0"></script>
107
+ <script src="https://cdn.jsdelivr.net/npm/@sythos/js_barcode_universal@1.1.0"></script>
108
108
  ```
109
109
 
110
110
  Pin the version for anything you ship; the unpinned form resolves to `latest` and will move under
@@ -209,8 +209,9 @@ time.
209
209
  | Pharmacode | `pharmacode` | 1D | ✅ | — |
210
210
  | QR Code | `qr` | 2D | ✅ | ✅ |
211
211
  | Data Matrix ECC 200 | `datamatrix` | 2D | ✅ | ✅ |
212
+ | Aztec Code | `aztec` | 2D | ✅ | ✅ |
212
213
 
213
- Seventeen formats, all writable, fourteen readable. **Code 11, MSI Plessey and Pharmacode are
214
+ Eighteen formats, all writable, fifteen readable. **Code 11, MSI Plessey and Pharmacode are
214
215
  write-only** — they encode correctly, but there is no reader for them, and `decode` will never
215
216
  return one.
216
217
 
@@ -219,35 +220,55 @@ they decode under that base id: a GS1-128 comes back as `code128`, an ITF-14 as
219
220
  as `ean13`. The payload is intact either way — a GS1-128 *is* a Code 128 with a leading FNC1, an
220
221
  ITF-14 *is* an ITF fixed at fourteen digits, and an ISBN barcode *is* an EAN-13 with a 978/979
221
222
  prefix. Match on `result.format === 'code128'` rather than `'gs1128'`, or a
222
- condition on the sub-variant id will silently never fire.
223
+ condition on the sub-variant id will silently never fire.
224
+
225
+ ### Data Matrix ECC 200
226
+
227
+ `datamatrix` writes and reads the 30 classic ECC 200 square and rectangular symbol sizes. The
228
+ encoder supports ASCII compaction (including numeric pairs), Base256 binary payloads, automatic
229
+ or forced square/rectangular shape, Reed–Solomon error correction and GS1 FNC1 in the first
230
+ position. DMRE is not included.
231
+
232
+ ```js
233
+ import { encodeDataMatrix, decodeDataMatrix } from '@sythos/js_barcode_universal/datamatrix';
234
+
235
+ const symbol = encodeDataMatrix('0101234567890128', { gs1: true, shape: 'square' });
236
+ const result = decodeDataMatrix(symbol);
237
+ console.log(result.text, result.gs1); // 0101234567890128 true
238
+ ```
239
+
240
+ Binary content is accepted as a `Uint8Array` with `encoding: 'base256'`. The current high-level
241
+ decoder handles ASCII and Base256 codewords; C40, Text, X12 and EDIFACT input symbols are not yet
242
+ decoded. The current detector accepts axis-aligned square or rectangular symbols; the normal
243
+ `decode(image, { formats: ['datamatrix'] })` pipeline also retries quarter-turn rotations.
244
+ Arbitrary-angle and perspective-skewed Data Matrix photographs are not yet guaranteed.
223
245
 
224
- ### Data Matrix ECC 200
246
+ ### Aztec Code
225
247
 
226
- `datamatrix` writes and reads the 30 classic ECC 200 square and rectangular symbol sizes. The
227
- encoder supports ASCII compaction (including numeric pairs), Base256 binary payloads, automatic
228
- or forced square/rectangular shape, Reed–Solomon error correction and GS1 FNC1 in the first
229
- position. DMRE is not included.
248
+ `aztec` writes Compact layers 1–4 and Full layers 1–32, selecting a fitting symbol automatically
249
+ unless `layers` and `compact` are forced. It supports the five Aztec text tables and UTF-8 byte
250
+ payloads through Binary Shift, with `eccPercent` (default 23) controlling the requested
251
+ error-correction level.
252
+ ECI is not yet a configurable public option.
230
253
 
231
254
  ```js
232
- import { encodeDataMatrix, decodeDataMatrix } from '@sythos/js_barcode_universal/datamatrix';
255
+ import { encodeAztec, decodeAztec } from '@sythos/js_barcode_universal/aztec';
233
256
 
234
- const symbol = encodeDataMatrix('0101234567890128', { gs1: true, shape: 'square' });
235
- const result = decodeDataMatrix(symbol);
236
- console.log(result.text, result.gs1); // 0101234567890128 true
257
+ const symbol = encodeAztec('Ciao, mondo 👋', { eccPercent: 23 });
258
+ const result = decodeAztec(symbol);
259
+ console.log(result.text); // Ciao, mondo 👋
237
260
  ```
238
261
 
239
- Binary content is accepted as a `Uint8Array` with `encoding: 'base256'`. The current high-level
240
- decoder handles ASCII and Base256 codewords; C40, Text, X12 and EDIFACT input symbols are not yet
241
- decoded. The current detector accepts axis-aligned square or rectangular symbols; the normal
242
- `decode(image, { formats: ['datamatrix'] })` pipeline also retries quarter-turn rotations.
243
- Arbitrary-angle and perspective-skewed Data Matrix photographs are not yet guaranteed.
262
+ The image detector handles rotation, inverted polarity and quadrilateral sampling around the
263
+ central bull’s-eye. Severe photographic perspective remains an interoperability and robustness
264
+ gate rather than a guaranteed capability.
244
265
 
245
266
  ### Not implemented
246
-
247
- **PDF417, Aztec, GS1 DataBar and MaxiCode are not implemented** — neither writing
248
- nor reading. Data Matrix ECC 200 is implemented for its classic square and rectangular symbols;
249
- DMRE remains outside the current scope. Some scaffolding for the remaining formats exists in the core (the Galois field code already handles
250
- the prime field PDF417 needs), but none of those remaining symbologies is usable today. See [`PLAN.md`](PLAN.md)
267
+
268
+ **PDF417, GS1 DataBar and MaxiCode are not implemented** — neither writing
269
+ nor reading. Data Matrix ECC 200 is implemented for its classic square and rectangular symbols;
270
+ DMRE remains outside the current scope. Some scaffolding for the remaining formats exists in the core (the Galois field code already handles
271
+ the prime field PDF417 needs), but none of those remaining symbologies is usable today. See [`PLAN.md`](PLAN.md)
251
272
  for where they sit.
252
273
 
253
274
  ---
@@ -255,7 +276,9 @@ for where they sit.
255
276
  ## Live examples
256
277
 
257
278
  Two self-contained pages, each loading the IIFE bundle with a plain `<script>` tag. **Both open
258
- directly from disk** — double-click the file, no server and no build.
279
+ directly from disk** — double-click the file, no server and no build. This `examples/` directory is
280
+ the single canonical source; the development workspace references these files instead of keeping
281
+ a second copy.
259
282
 
260
283
  ### [`examples/create.html`](examples/create.html)
261
284
 
@@ -289,15 +312,18 @@ hatch.
289
312
  encode(text, options?) → BitMatrix
290
313
  ```
291
314
 
292
- `options`: `format` (default `'qr'`), `ecc` (`'L'|'M'|'Q'|'H'`), `version` (QR 1–40, auto if
315
+ `options`: `format` (default `'qr'`), `ecc` (`'L'|'M'|'Q'|'H'`), `version` (QR 1–40, auto if
293
316
  omitted), `checkDigit`, `fullAscii` (Code 39 extended), `gs1` (emit a leading FNC1). Data Matrix
294
317
  ECC 200 accepts `shape: 'any' | 'square' | 'rectangular'` and `encoding: 'ascii' | 'base256'`.
318
+ Aztec accepts `layers`, `compact` and `eccPercent`; it transports UTF-8 byte payloads through
319
+ Binary Shift, and it does not expose configurable ECI yet.
295
320
 
296
321
  ```js
297
322
  encode('5901234123457', { format: 'ean13' })
298
323
  encode('ABC-123', { format: 'code39', fullAscii: true, checkDigit: true })
299
- encode('https://example.com', { format: 'qr', ecc: 'H', version: 7 })
324
+ encode('https://example.com', { format: 'qr', ecc: 'H', version: 7 })
300
325
  encode('0101234567890128', { format: 'datamatrix', gs1: true })
326
+ encode('Ciao, mondo 👋', { format: 'aztec', eccPercent: 23 })
301
327
  ```
302
328
 
303
329
  ```js
@@ -379,12 +405,12 @@ margin ends up uniform on all four sides.
379
405
  RGBA bytes → luminance → binarize → detect → sample → error-correct → decode
380
406
  ```
381
407
 
382
- Luminance conversion flattens the image to greyscale. Binarization turns that into a `BitMatrix`,
383
- either globally or with a hybrid local threshold that survives uneven lighting. Detection locates
384
- a symbol and its corners in that bit plane. Detectors that recover four perspective-aware corners
385
- (currently QR) sample the symbol back through a perspective transform. Data Matrix currently uses
386
- an axis-aligned bounding box plus quarter-turn retries. Error correction repairs what the camera
387
- lost. Only then is the payload decoded.
408
+ Luminance conversion flattens the image to greyscale. Binarization turns that into a `BitMatrix`,
409
+ either globally or with a hybrid local threshold that survives uneven lighting. Detection locates
410
+ a symbol and its corners in that bit plane. Detectors that recover four perspective-aware corners
411
+ (currently QR) sample the symbol back through a perspective transform. Data Matrix currently uses
412
+ an axis-aligned bounding box plus quarter-turn retries. Error correction repairs what the camera
413
+ lost. Only then is the payload decoded.
388
414
 
389
415
  **Reed–Solomon is generic over the finite field.** The `GaloisField` class is constructed with a
390
416
  field order and a primitive polynomial rather than hard-coding GF(256), which is what lets one
@@ -435,15 +461,15 @@ authorship — and from constant tables generated by this project's own scripts
435
461
  derivable rather than arbitrary. There is consequently no upstream licence to carry and no
436
462
  co-author to credit.
437
463
 
438
- **Trademark is not licence.** QR Code® is a registered trademark of DENSO WAVE; Aztec Code,
439
- MaxiCode and GS1 DataBar are likewise marks of their owners. A trademark does not restrict
440
- implementing a symbology, but it does constrain branding — which is why this package is named
441
- descriptively rather than after any mark.
442
-
443
- Data Matrix ECC 200 is governed by ISO/IEC 16022:2024; GS1 DataMatrix additionally uses the GS1
444
- General Specifications and a leading FNC1. Its engineering provenance, patent and trademark
445
- research notes are recorded in [`licenses/data-matrix.license`](licenses/data-matrix.license),
446
- with unresolved claims kept explicitly marked `[TO VERIFY]`.
464
+ **Trademark is not licence.** QR Code® is a registered trademark of DENSO WAVE; Aztec Code,
465
+ MaxiCode and GS1 DataBar are likewise marks of their owners. A trademark does not restrict
466
+ implementing a symbology, but it does constrain branding — which is why this package is named
467
+ descriptively rather than after any mark.
468
+
469
+ Data Matrix ECC 200 is governed by ISO/IEC 16022:2024; GS1 DataMatrix additionally uses the GS1
470
+ General Specifications and a leading FNC1. Its engineering provenance, patent and trademark
471
+ research notes are recorded in [`licenses/data-matrix.license`](licenses/data-matrix.license),
472
+ with unresolved claims kept explicitly marked `[TO VERIFY]`.
447
473
 
448
474
  [`LICENSE`](LICENSE) carries the full MIT text plus an informational appendix inventorying the
449
475
  specification copyrights, patent history and trademarks that surround these symbologies. None of