Skip to main content

Module code93

Module code93 

Source
Expand description

Code 93 encoder and structural decoder.

Code 93 is a continuous linear symbology designed as a denser, more secure successor to Code 39. Every character is exactly nine modules wide (three bars and three spaces, each 1–4 modules) and characters abut with no inter-character gap. A symbol is * <data> C K * followed by a single terminating bar, where C and K are two mandatory modulo-47 check characters.

Beyond the 43 base characters shared with Code 39 (0-9 A-Z - . SPACE $ / + %), Code 93 defines four dedicated shift characters (values 43–46, written ($) (%) (/) (+)) used only by the full-ASCII extension. Because these shifts are distinct from the literal $ % / + data characters, full-ASCII is detected in-band: a stream is full-ASCII exactly when it uses a shift character. Code93Meta therefore only records the full-ASCII flag; both check characters are always present and always validated.

§Pattern table and algorithm sources

The nine-module binary patterns are taken verbatim from the Code 93 article on Wikipedia. The C/K check algorithm (weights 1..=20 for C and 1..=15 for K, taken right-to-left, modulo 47, with C included in K) is from Bar Code Island’s Code 93 specification (http://www.barcodeisland.com/code93.phtml); worked example TEST93 → C = +, K = 6.

Structs§

Code93Decoder
Code 93 decoder. Full-ASCII is detected in-band and both check characters are always validated, so no configuration is required.
Code93Encoder
Code 93 encoder.
Code93Meta
Parameters required to re-encode a Code 93 symbol identically (lossless round-trip).