Skip to content

MSI1010 (Double Mod 10)

MSI1010 uses two Mod 10 check digits for enhanced error detection. This variant adds an additional layer of security by applying the Mod 10 algorithm twice, making it more reliable than single-check variants.

Basic Usage

ts
import { barcode } from '@stacksjs/qrx'

barcode('#barcode', '1234', { format: 'MSI1010' }) // Result: 123448

[!NOTE] Image needed: Basic MSI1010 barcode example

Double Mod 10 Checksum Calculation

The checksum is calculated in two stages:

  1. First Mod 10 check digit calculation

    • Multiply alternate digits by 2, right to left
    • Sum all digits
    • Calculate first check digit
  2. Second Mod 10 check digit calculation

    • Add first check digit to original number
    • Repeat Mod 10 calculation
    • Calculate second check digit

Example:

Data: 1234
First Check Digit:
  Step 1: 1 2 3 4 → (1)(2×2)(3)(4×2)
  Step 2: 1 4 3 8
  Step 3: 1 + 4 + 3 + 8 = 16
  Step 4: First check digit = 4
  Intermediate: 12344

Second Check Digit:
  Step 1: 1 2 3 4 4 → (1)(2×2)(3)(4×2)(4)
  Step 2: 1 4 3 8 4
  Step 3: 1 + 4 + 3 + 8 + 4 = 20
  Step 4: Second check digit = 8
Final Result: 123448

Advanced Options

ts
import { barcode } from '@stacksjs/qrx'

barcode('#barcode', '1234', {
  format: 'MSI1010',
  width: 2,
  height: 100,
  displayValue: true,
  fontSize: 20,
  font: 'monospace',
  textAlign: 'center',
  textPosition: 'bottom',
  textMargin: 2,
  background: '#ffffff',
  lineColor: '#000000'
})

Error Detection

ts
import { barcode } from '@stacksjs/qrx'

barcode('#barcode', '1234', {
  format: 'MSI1010',
  valid: (valid) => {
    if (!valid) {
      console.error('Invalid MSI1010 input')
      // Handle invalid input
    }
  }
})

Common Applications

  1. Critical Inventory

    • High-value items
    • Regulated materials
    • Sensitive products
  2. Quality Control

    • Production tracking
    • Batch verification
    • Process validation

[!NOTE] Image needed: Real-world application examples

Best Practices

  1. Input Validation

    • Verify numeric-only input
    • Check maximum length
    • Validate both check digits
  2. Implementation

    • Test scanner compatibility
    • Verify double checksum calculation
    • Maintain adequate quiet zones
  3. When to Use MSI1010

    • High-security applications
    • Critical data accuracy needed
    • Double validation required

Comparison with Other MSI Variants

FeatureMSI1010MSI10MSI11MSI1110
Check Digits2112
AlgorithmMod 10×2Mod 10Mod 11Mod 11+10
Error DetectionBetterBasicGoodBest
Data LengthLongerShorterShorterLonger

[!NOTE] Image needed: Visual comparison of variants

Error Detection Capabilities

MSI1010 can detect:

  • Single digit errors
  • Double digit errors
  • Most transposition errors
  • Many random errors
  • Sequential errors

Migration Considerations

ts
// Upgrade from MSI10
barcode('#barcode', '1234', { format: 'MSI10' })  // Single check
barcode('#barcode', '1234', { format: 'MSI1010' }) // Double check

// Alternative double-check option
barcode('#barcode', '1234', { format: 'MSI1110' }) // Mod 11 + Mod 10

Technical Notes

  1. Length Considerations

    • Two additional digits
    • Longer than single-check variants
    • Scanner configuration needed
  2. Validation Process

    • Two-step verification
    • Independent check digits
    • Enhanced error detection
  3. Implementation Tips

    • Verify scanner support
    • Test both checksums
    • Consider space requirements

[!NOTE] Image needed: Technical diagram showing double check digit calculation

Released under the MIT License.