also looking at this
chore(deps): update dependency react to 19.2.7
#2137
222 files
+16350
-1825
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -85,14 +85,7 @@ const sidebar = [ | ||
| 85 | 85 | { text: 'UPC-E', link: '/api/barcode/EAN/UPC-E' }, |
| 86 | 86 | ] |
| 87 | 87 | }, |
| 88 | { | |
| 89 | text: 'ITF', | |
| 90 | link: '/api/barcode/ITF', | |
| 91 | items: [ | |
| 92 | { text: 'ITF', link: '/api/barcode/ITF/ITF' }, | |
| 93 | { text: 'ITF-14', link: '/api/barcode/ITF/ITF14' }, | |
| 94 | ] | |
| 95 | }, | |
| 88 | { text: 'ITF-14', link: '/api/barcode/ITF-14' }, | |
| 96 | 89 | { |
| 97 | 90 | text: 'MSI', |
| 98 | 91 | link: '/api/barcode/MSI', |
| @@ -1,27 +0,0 @@ | ||
| 1 | # MSI | |
| 2 | ||
| 3 | MSI or *Modified Plessey* is a barcode developed by the MSI Data Corporation and is primarily used for inventory control, marking storage containers and shelves in warehouse environments. It supports digits 0-9. `qrx` provides automatic checksum calculation of *Mod 10*, *Mod 11*, *Mod 1010* and *Mod 1110*. | |
| 4 | ||
| 5 | ## Supported modes | |
| 6 | ||
| 7 | ```ts | |
| 8 | import { barcode } from '@stacksjs/qrx' | |
| 9 | ||
| 10 | barcode('#barcode', '1234', { format: 'MSI' }) // Result: 1234 | |
| 11 | barcode('#barcode', '1234', { format: 'MSI10' }) // Result: 12344 | |
| 12 | barcode('#barcode', '1234', { format: 'MSI11' }) // Result: 12343 | |
| 13 | barcode('#barcode', '1234', { format: 'MSI1010' }) // Result: 123448 | |
| 14 | barcode('#barcode', '1234', { format: 'MSI1110' }) // Result: 123430 | |
| 15 | ``` | |
| 16 | ||
| 17 | ## Example | |
| 18 | ||
| 19 | ```ts | |
| 20 | import { barcode } from '@stacksjs/qrx' | |
| 21 | ||
| 22 | barcode('#barcode', '123456789', { | |
| 23 | format: 'MSI' | |
| 24 | }) | |
| 25 | ``` | |
| 26 | ||
| 27 |  | |
| @@ -0,0 +1,123 @@ | ||
| 1 | # MSI10 (Mod 10) | |
| 2 | ||
| 3 | MSI10 is the MSI variant that uses a single Mod 10 check digit for error detection. This is the most common MSI variant, providing basic error detection while maintaining simplicity. | |
| 4 | ||
| 5 | ## Basic Usage | |
| 6 | ||
| 7 | ```ts | |
| 8 | import { barcode } from '@stacksjs/qrx' | |
| 9 | ||
| 10 | barcode('#barcode', '1234', { format: 'MSI10' }) // Result: 12344 | |
| 11 | ``` | |
| 12 | ||
| 13 | [!NOTE] Image needed: Basic MSI10 barcode example | |
| 14 | ||
| 15 | ## Mod 10 Checksum Calculation | |
| 16 | ||
| 17 | The Mod 10 checksum is calculated as follows: | |
| 18 | 1. Multiply alternate digits by 2, starting from the right | |
| 19 | 2. Sum the individual digits of the products | |
| 20 | 3. Add the remaining numbers | |
| 21 | 4. The check digit is the number needed to make sum divisible by 10 | |
| 22 | ||
| 23 | Example: | |
| 24 | ``` | |
| 25 | Data: 1234 | |
| 26 | Step 1: 1 2 3 4 → (1)(2×2)(3)(4×2) | |
| 27 | Step 2: 1 4 3 8 | |
| 28 | Step 3: 1 + 4 + 3 + 8 = 16 | |
| 29 | Step 4: Check digit = 4 (to make 16 + 4 = 20) | |
| 30 | Result: 12344 | |
| 31 | ``` | |
| 32 | ||
| 33 | ## Advanced Options | |
| 34 | ||
| 35 | ```ts | |
| 36 | import { barcode } from '@stacksjs/qrx' | |
| 37 | ||
| 38 | barcode('#barcode', '1234', { | |
| 39 | format: 'MSI10', | |
| 40 | width: 2, | |
| 41 | height: 100, | |
| 42 | displayValue: true, | |
| 43 | fontSize: 20, | |
| 44 | font: 'monospace', | |
| 45 | textAlign: 'center', | |
| 46 | textPosition: 'bottom', | |
| 47 | textMargin: 2, | |
| 48 | background: '#ffffff', | |
| 49 | lineColor: '#000000' | |
| 50 | }) | |
| 51 | ``` | |
| 52 | ||
| 53 | ## Error Detection | |
| 54 | ||
| 55 | ```ts | |
| 56 | import { barcode } from '@stacksjs/qrx' | |
| 57 | ||
| 58 | barcode('#barcode', '1234', { | |
| 59 | format: 'MSI10', | |
| 60 | valid: (valid) => { | |
| 61 | if (!valid) { | |
| 62 | console.error('Invalid MSI10 input') | |
| 63 | // Handle invalid input | |
| 64 | } | |
| 65 | } | |
| 66 | }) | |
| 67 | ``` | |
| 68 | ||
| 69 | ## Common Applications | |
| 70 | ||
| 71 | 1. **Retail Inventory** | |
| 72 | - Shelf labels | |
| 73 | - Price tags | |
| 74 | - Basic inventory control | |
| 75 | ||
| 76 | 2. **Simple Asset Tracking** | |
| 77 | - Basic equipment labeling | |
| 78 | - Location marking | |
| 79 | - Container identification | |
| 80 | ||
| 81 | [!NOTE] Image needed: Real-world application examples | |
| 82 | ||
| 83 | ## Best Practices | |
| 84 | ||
| 85 | 1. **Input Validation** | |
| 86 | - Verify numeric-only input | |
| 87 | - Check maximum length | |
| 88 | - Validate check digit | |
| 89 | ||
| 90 | 2. **Implementation** | |
| 91 | - Test scanner compatibility | |
| 92 | - Verify checksum calculation | |
| 93 | - Maintain adequate quiet zones | |
| 94 | ||
| 95 | 3. **When to Use MSI10** | |
| 96 | - Basic inventory tracking | |
| 97 | - Simple shelf marking | |
| 98 | - When single check digit is sufficient | |
| 99 | ||
| 100 | ## Comparison with Other MSI Variants | |
| 101 | ||
| 102 | | Feature | MSI10 | MSI11 | MSI1010 | MSI1110 | | |
| 103 | |---------|-------|-------|---------|----------| | |
| 104 | | Check Digits | 1 | 1 | 2 | 2 | | |
| 105 | | Algorithm | Mod 10 | Mod 11 | Mod 10×2 | Mod 11+10 | | |
| 106 | | Error Detection | Basic | Good | Better | Best | | |
| 107 | | Data Length | Shorter | Shorter | Longer | Longer | | |
| 108 | ||
| 109 | [!NOTE] Image needed: Visual comparison of variants | |
| 110 | ||
| 111 | ## Upgrade Path | |
| 112 | ||
| 113 | If you need better error detection, consider upgrading to: | |
| 114 | ```ts | |
| 115 | // Current MSI10 | |
| 116 | barcode('#barcode', '1234', { format: 'MSI10' }) | |
| 117 | ||
| 118 | // Upgrade to MSI1010 for double check digit | |
| 119 | barcode('#barcode', '1234', { format: 'MSI1010' }) | |
| 120 | ||
| 121 | // Upgrade to MSI1110 for maximum security | |
| 122 | barcode('#barcode', '1234', { format: 'MSI1110' }) | |
| 123 | ``` | |
| @@ -0,0 +1,164 @@ | ||
| 1 | # MSI1010 (Double Mod 10) | |
| 2 | ||
| 3 | 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. | |
| 4 | ||
| 5 | ## Basic Usage | |
| 6 | ||
| 7 | ```ts | |
| 8 | import { barcode } from '@stacksjs/qrx' | |
| 9 | ||
| 10 | barcode('#barcode', '1234', { format: 'MSI1010' }) // Result: 123448 | |
| 11 | ``` | |
| 12 | ||
| 13 | [!NOTE] Image needed: Basic MSI1010 barcode example | |
| 14 | ||
| 15 | ## Double Mod 10 Checksum Calculation | |
| 16 | ||
| 17 | The checksum is calculated in two stages: | |
| 18 | ||
| 19 | 1. First Mod 10 check digit calculation | |
| 20 | - Multiply alternate digits by 2, right to left | |
| 21 | - Sum all digits | |
| 22 | - Calculate first check digit | |
| 23 | ||
| 24 | 2. Second Mod 10 check digit calculation | |
| 25 | - Add first check digit to original number | |
| 26 | - Repeat Mod 10 calculation | |
| 27 | - Calculate second check digit | |
| 28 | ||
| 29 | Example: | |
| 30 | ||
| 31 | ``` | |
| 32 | Data: 1234 | |
| 33 | First Check Digit: | |
| 34 | Step 1: 1 2 3 4 → (1)(2×2)(3)(4×2) | |
| 35 | Step 2: 1 4 3 8 | |
| 36 | Step 3: 1 + 4 + 3 + 8 = 16 | |
| 37 | Step 4: First check digit = 4 | |
| 38 | Intermediate: 12344 | |
| 39 | ||
| 40 | Second Check Digit: | |
| 41 | Step 1: 1 2 3 4 4 → (1)(2×2)(3)(4×2)(4) | |
| 42 | Step 2: 1 4 3 8 4 | |
| 43 | Step 3: 1 + 4 + 3 + 8 + 4 = 20 | |
| 44 | Step 4: Second check digit = 8 | |
| 45 | Final Result: 123448 | |
| 46 | ``` | |
| 47 | ||
| 48 | ## Advanced Options | |
| 49 | ||
| 50 | ```ts | |
| 51 | import { barcode } from '@stacksjs/qrx' | |
| 52 | ||
| 53 | barcode('#barcode', '1234', { | |
| 54 | format: 'MSI1010', | |
| 55 | width: 2, | |
| 56 | height: 100, | |
| 57 | displayValue: true, | |
| 58 | fontSize: 20, | |
| 59 | font: 'monospace', | |
| 60 | textAlign: 'center', | |
| 61 | textPosition: 'bottom', | |
| 62 | textMargin: 2, | |
| 63 | background: '#ffffff', | |
| 64 | lineColor: '#000000' | |
| 65 | }) | |
| 66 | ``` | |
| 67 | ||
| 68 | ## Error Detection | |
| 69 | ||
| 70 | ```ts | |
| 71 | import { barcode } from '@stacksjs/qrx' | |
| 72 | ||
| 73 | barcode('#barcode', '1234', { | |
| 74 | format: 'MSI1010', | |
| 75 | valid: (valid) => { | |
| 76 | if (!valid) { | |
| 77 | console.error('Invalid MSI1010 input') | |
| 78 | // Handle invalid input | |
| 79 | } | |
| 80 | } | |
| 81 | }) | |
| 82 | ``` | |
| 83 | ||
| 84 | ## Common Applications | |
| 85 | ||
| 86 | 1. **Critical Inventory** | |
| 87 | - High-value items | |
| 88 | - Regulated materials | |
| 89 | - Sensitive products | |
| 90 | ||
| 91 | 2. **Quality Control** | |
| 92 | - Production tracking | |
| 93 | - Batch verification | |
| 94 | - Process validation | |
| 95 | ||
| 96 | [!NOTE] Image needed: Real-world application examples | |
| 97 | ||
| 98 | ## Best Practices | |
| 99 | ||
| 100 | 1. **Input Validation** | |
| 101 | - Verify numeric-only input | |
| 102 | - Check maximum length | |
| 103 | - Validate both check digits | |
| 104 | ||
| 105 | 2. **Implementation** | |
| 106 | - Test scanner compatibility | |
| 107 | - Verify double checksum calculation | |
| 108 | - Maintain adequate quiet zones | |
| 109 | ||
| 110 | 3. **When to Use MSI1010** | |
| 111 | - High-security applications | |
| 112 | - Critical data accuracy needed | |
| 113 | - Double validation required | |
| 114 | ||
| 115 | ## Comparison with Other MSI Variants | |
| 116 | ||
| 117 | | Feature | MSI1010 | MSI10 | MSI11 | MSI1110 | | |
| 118 | |---------|---------|-------|-------|----------| | |
| 119 | | Check Digits | 2 | 1 | 1 | 2 | | |
| 120 | | Algorithm | Mod 10×2 | Mod 10 | Mod 11 | Mod 11+10 | | |
| 121 | | Error Detection | Better | Basic | Good | Best | | |
| 122 | | Data Length | Longer | Shorter | Shorter | Longer | | |
| 123 | ||
| 124 | [!NOTE] Image needed: Visual comparison of variants | |
| 125 | ||
| 126 | ## Error Detection Capabilities | |
| 127 | ||
| 128 | MSI1010 can detect: | |
| 129 | ||
| 130 | - Single digit errors | |
| 131 | - Double digit errors | |
| 132 | - Most transposition errors | |
| 133 | - Many random errors | |
| 134 | - Sequential errors | |
| 135 | ||
| 136 | ## Migration Considerations | |
| 137 | ||
| 138 | ```ts | |
| 139 | // Upgrade from MSI10 | |
| 140 | barcode('#barcode', '1234', { format: 'MSI10' }) // Single check | |
| 141 | barcode('#barcode', '1234', { format: 'MSI1010' }) // Double check | |
| 142 | ||
| 143 | // Alternative double-check option | |
| 144 | barcode('#barcode', '1234', { format: 'MSI1110' }) // Mod 11 + Mod 10 | |
| 145 | ``` | |
| 146 | ||
| 147 | ## Technical Notes | |
| 148 | ||
| 149 | 1. **Length Considerations** | |
| 150 | - Two additional digits | |
| 151 | - Longer than single-check variants | |
| 152 | - Scanner configuration needed | |
| 153 | ||
| 154 | 2. **Validation Process** | |
| 155 | - Two-step verification | |
| 156 | - Independent check digits | |
| 157 | - Enhanced error detection | |
| 158 | ||
| 159 | 3. **Implementation Tips** | |
| 160 | - Verify scanner support | |
| 161 | - Test both checksums | |
| 162 | - Consider space requirements | |
| 163 | ||
| 164 | [!NOTE] Image needed: Technical diagram showing double check digit calculation | |
| @@ -0,0 +1,154 @@ | ||
| 1 | # MSI11 (Mod 11) | |
| 2 | ||
| 3 | MSI11 is the MSI variant that uses a single Mod 11 check digit for error detection. It provides stronger error detection than MSI10 by using a different checksum algorithm. | |
| 4 | ||
| 5 | ## Basic Usage | |
| 6 | ||
| 7 | ```ts | |
| 8 | import { barcode } from '@stacksjs/qrx' | |
| 9 | ||
| 10 | barcode('#barcode', '1234', { format: 'MSI11' }) // Result: 12343 | |
| 11 | ``` | |
| 12 | ||
| 13 | [!NOTE] Image needed: Basic MSI11 barcode example | |
| 14 | ||
| 15 | ## Mod 11 Checksum Calculation | |
| 16 | ||
| 17 | The Mod 11 checksum uses a weighted system: | |
| 18 | ||
| 19 | 1. Assign weights (2,3,4,5,6,7) to digits from right to left, repeating if needed | |
| 20 | 2. Multiply each digit by its weight and sum results | |
| 21 | 3. Calculate Mod 11 of the sum | |
| 22 | 4. Subtract from 11 to get check digit (if 11, use 0; if 10, use 1) | |
| 23 | ||
| 24 | Example: | |
| 25 | ||
| 26 | ``` | |
| 27 | Data: 1234 | |
| 28 | Weights: 5,4,3,2 (right to left) | |
| 29 | Step 1: (1×5) + (2×4) + (3×3) + (4×2) = 5 + 8 + 9 + 8 = 30 | |
| 30 | Step 2: 30 mod 11 = 8 | |
| 31 | Step 3: 11 - 8 = 3 | |
| 32 | Result: 12343 | |
| 33 | ``` | |
| 34 | ||
| 35 | ## Advanced Options | |
| 36 | ||
| 37 | ```ts | |
| 38 | import { barcode } from '@stacksjs/qrx' | |
| 39 | ||
| 40 | barcode('#barcode', '1234', { | |
| 41 | format: 'MSI11', | |
| 42 | width: 2, | |
| 43 | height: 100, | |
| 44 | displayValue: true, | |
| 45 | fontSize: 20, | |
| 46 | font: 'monospace', | |
| 47 | textAlign: 'center', | |
| 48 | textPosition: 'bottom', | |
| 49 | textMargin: 2, | |
| 50 | background: '#ffffff', | |
| 51 | lineColor: '#000000' | |
| 52 | }) | |
| 53 | ``` | |
| 54 | ||
| 55 | ## Error Detection | |
| 56 | ||
| 57 | ```ts | |
| 58 | import { barcode } from '@stacksjs/qrx' | |
| 59 | ||
| 60 | barcode('#barcode', '1234', { | |
| 61 | format: 'MSI11', | |
| 62 | valid: (valid) => { | |
| 63 | if (!valid) { | |
| 64 | console.error('Invalid MSI11 input') | |
| 65 | // Handle invalid input | |
| 66 | } | |
| 67 | } | |
| 68 | }) | |
| 69 | ``` | |
| 70 | ||
| 71 | ## Common Applications | |
| 72 | ||
| 73 | 1. **Industrial Control** | |
| 74 | - Manufacturing tracking | |
| 75 | - Quality control labeling | |
| 76 | - Process control | |
| 77 | ||
| 78 | 2. **Warehouse Management** | |
| 79 | - High-accuracy inventory | |
| 80 | - Critical item tracking | |
| 81 | - Location verification | |
| 82 | ||
| 83 | [!NOTE] Image needed: Real-world application examples | |
| 84 | ||
| 85 | ## Best Practices | |
| 86 | ||
| 87 | 1. **Input Validation** | |
| 88 | - Verify numeric-only input | |
| 89 | - Check maximum length | |
| 90 | - Validate Mod 11 check digit | |
| 91 | ||
| 92 | 2. **Implementation** | |
| 93 | - Test scanner compatibility | |
| 94 | - Verify checksum calculation | |
| 95 | - Maintain adequate quiet zones | |
| 96 | ||
| 97 | 3. **When to Use MSI11** | |
| 98 | - Higher security needs than MSI10 | |
| 99 | - Critical inventory tracking | |
| 100 | - When error detection is important | |
| 101 | ||
| 102 | ## Comparison with Other MSI Variants | |
| 103 | ||
| 104 | | Feature | MSI11 | MSI10 | MSI1010 | MSI1110 | | |
| 105 | |---------|-------|-------|---------|----------| | |
| 106 | | Check Digits | 1 | 1 | 2 | 2 | | |
| 107 | | Algorithm | Mod 11 | Mod 10 | Mod 10×2 | Mod 11+10 | | |
| 108 | | Error Detection | Better | Basic | Better | Best | | |
| 109 | | Data Length | Shorter | Shorter | Longer | Longer | | |
| 110 | ||
| 111 | [!NOTE] Image needed: Visual comparison of variants | |
| 112 | ||
| 113 | ## Error Types Detected | |
| 114 | ||
| 115 | MSI11 can detect: | |
| 116 | ||
| 117 | - Single digit errors (100%) | |
| 118 | - Transposition errors (100%) | |
| 119 | - Most double digit errors | |
| 120 | - Many random errors | |
| 121 | ||
| 122 | ## Migration Options | |
| 123 | ||
| 124 | If different error detection is needed: | |
| 125 | ||
| 126 | ```ts | |
| 127 | // Current MSI11 | |
| 128 | barcode('#barcode', '1234', { format: 'MSI11' }) | |
| 129 | ||
| 130 | // Switch to MSI10 for simpler validation | |
| 131 | barcode('#barcode', '1234', { format: 'MSI10' }) | |
| 132 | ||
| 133 | // Upgrade to MSI1110 for maximum security | |
| 134 | barcode('#barcode', '1234', { format: 'MSI1110' }) | |
| 135 | ``` | |
| 136 | ||
| 137 | ## Technical Notes | |
| 138 | ||
| 139 | 1. **Check Digit Range** | |
| 140 | - Values 0-9 (10 becomes 1, 11 becomes 0) | |
| 141 | - Non-sequential relationship to data | |
| 142 | - Weighted calculation method | |
| 143 | ||
| 144 | 2. **Scanner Compatibility** | |
| 145 | - Verify scanner supports Mod 11 | |
| 146 | - Check configuration requirements | |
| 147 | - Test with actual hardware | |
| 148 | ||
| 149 | 3. **Error Detection Strength** | |
| 150 | - Better than MSI10 for single errors | |
| 151 | - Strong against transpositions | |
| 152 | - Good for critical applications | |
| 153 | ||
| 154 | [!NOTE] Image needed: Technical diagram showing check digit calculation | |
| @@ -0,0 +1,165 @@ | ||
| 1 | # MSI1110 (Mod 11 + Mod 10) | |
| 2 | ||
| 3 | MSI1110 combines Mod 11 and Mod 10 checksums for maximum error detection. This hybrid approach offers the strongest error detection of all MSI variants by leveraging the strengths of both algorithms. | |
| 4 | ||
| 5 | ## Basic Usage | |
| 6 | ||
| 7 | ```ts | |
| 8 | import { barcode } from '@stacksjs/qrx' | |
| 9 | ||
| 10 | barcode('#barcode', '1234', { format: 'MSI1110' }) // Result: 123430 | |
| 11 | ``` | |
| 12 | ||
| 13 | [!NOTE] Image needed: Basic MSI1110 barcode example | |
| 14 | ||
| 15 | ## Combined Checksum Calculation | |
| 16 | ||
| 17 | The checksum calculation happens in two stages: | |
| 18 | ||
| 19 | 1. Mod 11 check digit calculation | |
| 20 | - Apply weights (2,3,4,5,6,7) right to left | |
| 21 | - Calculate first check digit using Mod 11 | |
| 22 | ||
| 23 | 2. Mod 10 check digit calculation | |
| 24 | - Add Mod 11 check digit to data | |
| 25 | - Apply Mod 10 algorithm | |
| 26 | - Calculate final check digit | |
| 27 | ||
| 28 | Example: | |
| 29 | ||
| 30 | ``` | |
| 31 | Data: 1234 | |
| 32 | Mod 11 Check Digit: | |
| 33 | Step 1: Weights (5,4,3,2) → (1×5) + (2×4) + (3×3) + (4×2) = 30 | |
| 34 | Step 2: 30 mod 11 = 8 | |
| 35 | Step 3: 11 - 8 = 3 | |
| 36 | Intermediate: 12343 | |
| 37 | ||
| 38 | Mod 10 Check Digit: | |
| 39 | Step 1: 1 2 3 4 3 → (1)(2×2)(3)(4×2)(3) | |
| 40 | Step 2: 1 4 3 8 3 | |
| 41 | Step 3: Sum = 19 | |
| 42 | Step 4: Final check digit = 0 | |
| 43 | Final Result: 123430 | |
| 44 | ``` | |
| 45 | ||
| 46 | ## Advanced Options | |
| 47 | ||
| 48 | ```ts | |
| 49 | import { barcode } from '@stacksjs/qrx' | |
| 50 | ||
| 51 | barcode('#barcode', '1234', { | |
| 52 | format: 'MSI1110', | |
| 53 | width: 2, | |
| 54 | height: 100, | |
| 55 | displayValue: true, | |
| 56 | fontSize: 20, | |
| 57 | font: 'monospace', | |
| 58 | textAlign: 'center', | |
| 59 | textPosition: 'bottom', | |
| 60 | textMargin: 2, | |
| 61 | background: '#ffffff', | |
| 62 | lineColor: '#000000' | |
| 63 | }) | |
| 64 | ``` | |
| 65 | ||
| 66 | ## Error Detection | |
| 67 | ||
| 68 | ```ts | |
| 69 | import { barcode } from '@stacksjs/qrx' | |
| 70 | ||
| 71 | barcode('#barcode', '1234', { | |
| 72 | format: 'MSI1110', | |
| 73 | valid: (valid) => { | |
| 74 | if (!valid) { | |
| 75 | console.error('Invalid MSI1110 input') | |
| 76 | // Handle invalid input | |
| 77 | } | |
| 78 | } | |
| 79 | }) | |
| 80 | ``` | |
| 81 | ||
| 82 | ## Common Applications | |
| 83 | ||
| 84 | 1. **High-Security Environments** | |
| 85 | - Pharmaceutical tracking | |
| 86 | - Medical supplies | |
| 87 | - Secure inventory | |
| 88 | ||
| 89 | 2. **Critical Systems** | |
| 90 | - Financial documents | |
| 91 | - Security labels | |
| 92 | - Regulatory compliance | |
| 93 | ||
| 94 | [!NOTE] Image needed: Real-world application examples | |
| 95 | ||
| 96 | ## Best Practices | |
| 97 | ||
| 98 | 1. **Input Validation** | |
| 99 | - Verify numeric-only input | |
| 100 | - Check maximum length | |
| 101 | - Validate both checksums | |
| 102 | ||
| 103 | 2. **Implementation** | |
| 104 | - Test scanner compatibility | |
| 105 | - Verify both algorithms | |
| 106 | - Maintain adequate quiet zones | |
| 107 | ||
| 108 | 3. **When to Use MSI1110** | |
| 109 | - Highest security needs | |
| 110 | - Critical error detection | |
| 111 | - Regulatory requirements | |
| 112 | ||
| 113 | ## Comparison with Other MSI Variants | |
| 114 | ||
| 115 | | Feature | MSI1110 | MSI10 | MSI11 | MSI1010 | | |
| 116 | |---------|---------|-------|-------|----------| | |
| 117 | | Check Digits | 2 | 1 | 1 | 2 | | |
| 118 | | Algorithm | Mod 11+10 | Mod 10 | Mod 11 | Mod 10×2 | | |
| 119 | | Error Detection | Best | Basic | Good | Better | | |
| 120 | | Data Length | Longer | Shorter | Shorter | Longer | | |
| 121 | ||
| 122 | [!NOTE] Image needed: Visual comparison of variants | |
| 123 | ||
| 124 | ## Error Detection Capabilities | |
| 125 | ||
| 126 | MSI1110 can detect: | |
| 127 | ||
| 128 | - All single digit errors | |
| 129 | - All transposition errors | |
| 130 | - Most double digit errors | |
| 131 | - Most random errors | |
| 132 | - Sequential errors | |
| 133 | - Substitution errors | |
| 134 | ||
| 135 | ## Migration Path | |
| 136 | ||
| 137 | ```ts | |
| 138 | // Upgrading from simpler variants | |
| 139 | barcode('#barcode', '1234', { format: 'MSI10' }) // Basic | |
| 140 | barcode('#barcode', '1234', { format: 'MSI11' }) // Better | |
| 141 | barcode('#barcode', '1234', { format: 'MSI1010' }) // Enhanced | |
| 142 | barcode('#barcode', '1234', { format: 'MSI1110' }) // Maximum | |
| 143 | ||
| 144 | // Alternative for space-constrained applications | |
| 145 | barcode('#barcode', '1234', { format: 'MSI11' }) // Single check, good detection | |
| 146 | ``` | |
| 147 | ||
| 148 | ## Technical Notes | |
| 149 | ||
| 150 | 1. **Validation Process** | |
| 151 | - Two-step verification | |
| 152 | - Different algorithms | |
| 153 | - Maximum detection capability | |
| 154 | ||
| 155 | 2. **Scanner Requirements** | |
| 156 | - Must support dual checksums | |
| 157 | - Configuration verification | |
| 158 | - Testing recommended | |
| 159 | ||
| 160 | 3. **Space Considerations** | |
| 161 | - Two additional digits | |
| 162 | - Longer than single-check variants | |
| 163 | - Quiet zone requirements | |
| 164 | ||
| 165 | [!NOTE] Image needed: Technical diagram showing combined check digit calculation | |
| @@ -0,0 +1,150 @@ | ||
| 1 | # MSI Barcode | |
| 2 | ||
| 3 | MSI _(Modified Plessey)_ is a specialized barcode format developed by the MSI Data Corporation. It's primarily used for inventory control, warehouse management, and retail shelf marking. The format supports numeric digits (0-9) and includes various checksum options for error detection. | |
| 4 | ||
| 5 | ## Basic Usage | |
| 6 | ||
| 7 | ```ts | |
| 8 | import { barcode } from '@stacksjs/qrx' | |
| 9 | ||
| 10 | barcode('#barcode', '123456789', { | |
| 11 | format: 'MSI' | |
| 12 | }) | |
| 13 | ``` | |
| 14 | ||
| 15 |  | |
| 16 | ||
| 17 | ## Available Variants | |
| 18 | ||
| 19 | qrx supports multiple MSI variants with different checksum calculations: | |
| 20 | ||
| 21 | ```ts | |
| 22 | // Basic MSI (no checksum) | |
| 23 | barcode('#barcode', '1234', { format: 'MSI' }) // Result: 1234 | |
| 24 | ||
| 25 | // With Mod 10 checksum | |
| 26 | barcode('#barcode', '1234', { format: 'MSI10' }) // Result: 12344 | |
| 27 | ||
| 28 | // With Mod 11 checksum | |
| 29 | barcode('#barcode', '1234', { format: 'MSI11' }) // Result: 12343 | |
| 30 | ||
| 31 | // With double Mod 10 checksum | |
| 32 | barcode('#barcode', '1234', { format: 'MSI1010' }) // Result: 123448 | |
| 33 | ||
| 34 | // With Mod 11 & Mod 10 checksum | |
| 35 | barcode('#barcode', '1234', { format: 'MSI1110' }) // Result: 123430 | |
| 36 | ``` | |
| 37 | ||
| 38 | [!NOTE] Image needed: Visual comparison of different MSI variants | |
| 39 | ||
| 40 | ## Customization Options | |
| 41 | ||
| 42 | ```ts | |
| 43 | import { barcode } from '@stacksjs/qrx' | |
| 44 | ||
| 45 | barcode('#barcode', '123456789', { | |
| 46 | format: 'MSI', | |
| 47 | width: 2, | |
| 48 | height: 100, | |
| 49 | displayValue: true, | |
| 50 | fontSize: 20, | |
| 51 | font: 'monospace', | |
| 52 | textAlign: 'center', | |
| 53 | textPosition: 'bottom', | |
| 54 | textMargin: 2, | |
| 55 | background: '#ffffff', | |
| 56 | lineColor: '#000000' | |
| 57 | }) | |
| 58 | ``` | |
| 59 | ||
| 60 | ## Common Applications | |
| 61 | ||
| 62 | 1. **Retail** | |
| 63 | - Shelf marking | |
| 64 | - Price labels | |
| 65 | - Inventory tags | |
| 66 | ||
| 67 | 2. **Warehouse** | |
| 68 | - Location marking | |
| 69 | - Bin labels | |
| 70 | - Storage containers | |
| 71 | ||
| 72 | 3. **Inventory Control** | |
| 73 | - Asset tracking | |
| 74 | - Stock management | |
| 75 | - Item identification | |
| 76 | ||
| 77 | [!NOTE] Image needed: Real-world application examples | |
| 78 | ||
| 79 | ## Error Handling | |
| 80 | ||
| 81 | ```ts | |
| 82 | import { barcode } from '@stacksjs/qrx' | |
| 83 | ||
| 84 | barcode('#barcode', '123456789', { | |
| 85 | format: 'MSI', | |
| 86 | valid: (valid) => { | |
| 87 | if (!valid) { | |
| 88 | console.error('Invalid MSI barcode input') | |
| 89 | // Handle invalid input | |
| 90 | } | |
| 91 | } | |
| 92 | }) | |
| 93 | ``` | |
| 94 | ||
| 95 | ## Technical Specifications | |
| 96 | ||
| 97 | 1. **Character Set** | |
| 98 | - Numeric only (0-9) | |
| 99 | - Variable length | |
| 100 | - Optional checksums | |
| 101 | ||
| 102 | 2. **Structure** | |
| 103 | - Start character | |
| 104 | - Data digits | |
| 105 | - Optional check digit(s) | |
| 106 | - Stop character | |
| 107 | ||
| 108 | 3. **Variants Available** | |
| 109 | - [MSI10](./MSI/MSI10.md) - Single Mod 10 | |
| 110 | - [MSI11](./MSI/MSI11.md) - Single Mod 11 | |
| 111 | - [MSI1010](./MSI/MSI1010.md) - Double Mod 10 | |
| 112 | - [MSI1110](./MSI/MSI1110.md) - Mod 11 & Mod 10 | |
| 113 | ||
| 114 | ## Best Practices | |
| 115 | ||
| 116 | 1. **Checksum Selection** | |
| 117 | - Use MSI10 for basic error detection | |
| 118 | - Use MSI1010 for enhanced reliability | |
| 119 | - Use MSI1110 for maximum security | |
| 120 | ||
| 121 | 2. **Implementation Guidelines** | |
| 122 | - Validate numeric input | |
| 123 | - Consider scanner compatibility | |
| 124 | - Test checksum verification | |
| 125 | ||
| 126 | 3. **Print Quality** | |
| 127 | - Maintain quiet zones | |
| 128 | - Ensure adequate contrast | |
| 129 | - Verify scanner readability | |
| 130 | ||
| 131 | [!NOTE] Image needed: Best practices visualization | |
| 132 | ||
| 133 | ## Migration Guide | |
| 134 | ||
| 135 | If transitioning from MSI to modern formats: | |
| 136 | ||
| 137 | ```ts | |
| 138 | // Current MSI implementation | |
| 139 | barcode('#barcode', '123456789', { format: 'MSI' }) | |
| 140 | ||
| 141 | // Modern alternative (CODE128) | |
| 142 | barcode('#barcode', '123456789', { format: 'CODE128' }) | |
| 143 | ``` | |
| 144 | ||
| 145 | For detailed information about specific MSI variants, see: | |
| 146 | ||
| 147 | - [MSI10 Documentation](./MSI/MSI10.md) | |
| 148 | - [MSI11 Documentation](./MSI/MSI11.md) | |
| 149 | - [MSI1010 Documentation](./MSI/MSI1010.md) | |
| 150 | - [MSI1110 Documentation](./MSI/MSI1110.md) | |