Summary
The Japan Post 4-state barcode (JP4SCC / Kasutama) encoding table in src/encoders/fourstate.ts may have incorrect bar state mappings. The table uses 3 bars per character, but the official Japan Post Customer Barcode spec uses different encoding.
Details
Current table:
const JP_TABLE: Record<string, FourState[]> = {
"0": ["F", "F", "T"],
"1": ["D", "A", "F"],
// ...
"-": ["F", "T", "F"],
};
Issues:
- Japan Post Customer Barcode uses 3 bars per character (confirmed), but the specific state assignments need verification against the official JP Post specification
- The address field encoding only accepts digits and dash (
/^[\d-]+$/), but Japan Post barcodes can include alphanumeric characters in the address field for some formats
- The check digit calculation sums character values and uses mod 10, which appears correct, but the character-to-value mapping (dash = 10) should be verified
- The start/stop bars
["F", "D"] and ["F", "A"] need verification — some references show different start/stop combinations
References
Summary
The Japan Post 4-state barcode (JP4SCC / Kasutama) encoding table in
src/encoders/fourstate.tsmay have incorrect bar state mappings. The table uses 3 bars per character, but the official Japan Post Customer Barcode spec uses different encoding.Details
Current table:
Issues:
/^[\d-]+$/), but Japan Post barcodes can include alphanumeric characters in the address field for some formats["F", "D"]and["F", "A"]need verification — some references show different start/stop combinationsReferences