Code 39
Code 39 is a variable-length linear barcode symbology, developed in 1974 and standardized as ISO/IEC 16388. The data density is comparatively low, so it requires considerably more space to encode the same amount of data and can not be used to label smaller items.
Code 39 is used in inventory and item tracking applications as well as some postal services.
A sample Code 39 barcode is shown below.
Symbology Characteristics
Configuration name |
|
ISO specification | ISO/IEC 16388 |
Encodable character set | Alphanumeric (A-Z) and numeric (0-9) as well as $ % + - . / and space characters |
Integrity protection | Optional mod 43 check digit |
Quiet zone | Leading and trailing quiet zone of at least ten modules (10X) is required |
Optional Check Digit
Code 39 supports an optional check digit for enhanced data security (ISO/IEC 16388:2007, A.1 Check Character). The check digit is placed immediately after the final data character and before the stop character.
By default, check digit verification is disabled (checksumMode
is set to 0
) and all characters, including the check digit, will be returned when the barcode is read. If the SDK is configured to validate the check digit, it can either be stripped (1
) or transmitted (2
).
Example: Code 39 barcode with check digit
In the barcode below, the R character is a check digit and the encoded data is CODE 39. The asterisk characters denote start and stop characters and are typically included in the human-readable interpretation but not transmitted by the decoder.
Configuration Options
Option | Description | Sample Configuration | Default |
---|---|---|---|
minLen | The minimum length of scanned codes |
const config = {
engine: {
symbologies: [
{ name: "code39", minLen: 8 }
]
}
}
| 4 |
maxLen | The maximum length of scanned codes |
const config = {
engine: {
symbologies: [
{ name: "code39", maxLen: 16 }
]
}
}
| 32 |
qz | The minimum size of the quiet zone, in modules (X) |
const config = {
engine: {
symbologies: [
{ name: "code39", qz: 10 }
]
}
}
| 5 |
checksumMode | Check digit (mod 43) processing mode: 0: no check digit expected 1: validate and strip check digit 2: validate and transmit check digit |
const config = {
engine: {
symbologies: [
{
name: "code39",
checksumMode: 1
}
]
}
}
| 0 |