ReviewOS

also looking at this

stacks/ts-qr-codes

chore(deps): update dependency react to 19.2.7

#2137
Closed chris wants to merge buddy-bot/update-major-update-react into main
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.

docs/.vitepress/config.tsmodified+1-8
Changes to docs/.vitepress/config.ts
@@ -85,14 +85,7 @@ const sidebar = [
8585 { text: 'UPC-E', link: '/api/barcode/EAN/UPC-E' },
8686 ]
8787 },
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' },
9689 {
9790 text: 'MSI',
9891 link: '/api/barcode/MSI',
docs/api/barcode/MSI.mddeleted+0-27
Changes to docs/api/barcode/MSI.md
@@ -1,27 +0,0 @@
1# MSI
2
3MSI 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
8import { barcode } from '@stacksjs/qrx'
9
10barcode('#barcode', '1234', { format: 'MSI' }) // Result: 1234
11barcode('#barcode', '1234', { format: 'MSI10' }) // Result: 12344
12barcode('#barcode', '1234', { format: 'MSI11' }) // Result: 12343
13barcode('#barcode', '1234', { format: 'MSI1010' }) // Result: 123448
14barcode('#barcode', '1234', { format: 'MSI1110' }) // Result: 123430
15```
16
17## Example
18
19```ts
20import { barcode } from '@stacksjs/qrx'
21
22barcode('#barcode', '123456789', {
23 format: 'MSI'
24})
25```
26
27![MSI Barcode](http://i.imgur.com/cm4ZQpE.png)
docs/api/barcode/MSI/MSI10.mdadded+123-0
Changes to docs/api/barcode/MSI/MSI10.md
@@ -0,0 +1,123 @@
1# MSI10 (Mod 10)
2
3MSI10 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
8import { barcode } from '@stacksjs/qrx'
9
10barcode('#barcode', '1234', { format: 'MSI10' }) // Result: 12344
11```
12
13[!NOTE] Image needed: Basic MSI10 barcode example
14
15## Mod 10 Checksum Calculation
16
17The Mod 10 checksum is calculated as follows:
181. Multiply alternate digits by 2, starting from the right
192. Sum the individual digits of the products
203. Add the remaining numbers
214. The check digit is the number needed to make sum divisible by 10
22
23Example:
24```
25Data: 1234
26Step 1: 1 2 3 4 → (1)(2×2)(3)(4×2)
27Step 2: 1 4 3 8
28Step 3: 1 + 4 + 3 + 8 = 16
29Step 4: Check digit = 4 (to make 16 + 4 = 20)
30Result: 12344
31```
32
33## Advanced Options
34
35```ts
36import { barcode } from '@stacksjs/qrx'
37
38barcode('#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
56import { barcode } from '@stacksjs/qrx'
57
58barcode('#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
711. **Retail Inventory**
72 - Shelf labels
73 - Price tags
74 - Basic inventory control
75
762. **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
851. **Input Validation**
86 - Verify numeric-only input
87 - Check maximum length
88 - Validate check digit
89
902. **Implementation**
91 - Test scanner compatibility
92 - Verify checksum calculation
93 - Maintain adequate quiet zones
94
953. **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
113If you need better error detection, consider upgrading to:
114```ts
115// Current MSI10
116barcode('#barcode', '1234', { format: 'MSI10' })
117
118// Upgrade to MSI1010 for double check digit
119barcode('#barcode', '1234', { format: 'MSI1010' })
120
121// Upgrade to MSI1110 for maximum security
122barcode('#barcode', '1234', { format: 'MSI1110' })
123```
docs/api/barcode/MSI/MSI1010.mdadded+164-0
Changes to docs/api/barcode/MSI/MSI1010.md
@@ -0,0 +1,164 @@
1# MSI1010 (Double Mod 10)
2
3MSI1010 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
8import { barcode } from '@stacksjs/qrx'
9
10barcode('#barcode', '1234', { format: 'MSI1010' }) // Result: 123448
11```
12
13[!NOTE] Image needed: Basic MSI1010 barcode example
14
15## Double Mod 10 Checksum Calculation
16
17The checksum is calculated in two stages:
18
191. 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
242. 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
29Example:
30
31```
32Data: 1234
33First 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
40Second 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
45Final Result: 123448
46```
47
48## Advanced Options
49
50```ts
51import { barcode } from '@stacksjs/qrx'
52
53barcode('#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
71import { barcode } from '@stacksjs/qrx'
72
73barcode('#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
861. **Critical Inventory**
87 - High-value items
88 - Regulated materials
89 - Sensitive products
90
912. **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
1001. **Input Validation**
101 - Verify numeric-only input
102 - Check maximum length
103 - Validate both check digits
104
1052. **Implementation**
106 - Test scanner compatibility
107 - Verify double checksum calculation
108 - Maintain adequate quiet zones
109
1103. **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
128MSI1010 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
140barcode('#barcode', '1234', { format: 'MSI10' }) // Single check
141barcode('#barcode', '1234', { format: 'MSI1010' }) // Double check
142
143// Alternative double-check option
144barcode('#barcode', '1234', { format: 'MSI1110' }) // Mod 11 + Mod 10
145```
146
147## Technical Notes
148
1491. **Length Considerations**
150 - Two additional digits
151 - Longer than single-check variants
152 - Scanner configuration needed
153
1542. **Validation Process**
155 - Two-step verification
156 - Independent check digits
157 - Enhanced error detection
158
1593. **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
docs/api/barcode/MSI/MSI11.mdadded+154-0
Changes to docs/api/barcode/MSI/MSI11.md
@@ -0,0 +1,154 @@
1# MSI11 (Mod 11)
2
3MSI11 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
8import { barcode } from '@stacksjs/qrx'
9
10barcode('#barcode', '1234', { format: 'MSI11' }) // Result: 12343
11```
12
13[!NOTE] Image needed: Basic MSI11 barcode example
14
15## Mod 11 Checksum Calculation
16
17The Mod 11 checksum uses a weighted system:
18
191. Assign weights (2,3,4,5,6,7) to digits from right to left, repeating if needed
202. Multiply each digit by its weight and sum results
213. Calculate Mod 11 of the sum
224. Subtract from 11 to get check digit (if 11, use 0; if 10, use 1)
23
24Example:
25
26```
27Data: 1234
28Weights: 5,4,3,2 (right to left)
29Step 1: (1×5) + (2×4) + (3×3) + (4×2) = 5 + 8 + 9 + 8 = 30
30Step 2: 30 mod 11 = 8
31Step 3: 11 - 8 = 3
32Result: 12343
33```
34
35## Advanced Options
36
37```ts
38import { barcode } from '@stacksjs/qrx'
39
40barcode('#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
58import { barcode } from '@stacksjs/qrx'
59
60barcode('#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
731. **Industrial Control**
74 - Manufacturing tracking
75 - Quality control labeling
76 - Process control
77
782. **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
871. **Input Validation**
88 - Verify numeric-only input
89 - Check maximum length
90 - Validate Mod 11 check digit
91
922. **Implementation**
93 - Test scanner compatibility
94 - Verify checksum calculation
95 - Maintain adequate quiet zones
96
973. **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
115MSI11 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
124If different error detection is needed:
125
126```ts
127// Current MSI11
128barcode('#barcode', '1234', { format: 'MSI11' })
129
130// Switch to MSI10 for simpler validation
131barcode('#barcode', '1234', { format: 'MSI10' })
132
133// Upgrade to MSI1110 for maximum security
134barcode('#barcode', '1234', { format: 'MSI1110' })
135```
136
137## Technical Notes
138
1391. **Check Digit Range**
140 - Values 0-9 (10 becomes 1, 11 becomes 0)
141 - Non-sequential relationship to data
142 - Weighted calculation method
143
1442. **Scanner Compatibility**
145 - Verify scanner supports Mod 11
146 - Check configuration requirements
147 - Test with actual hardware
148
1493. **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
docs/api/barcode/MSI/MSI1110.mdadded+165-0
Changes to docs/api/barcode/MSI/MSI1110.md
@@ -0,0 +1,165 @@
1# MSI1110 (Mod 11 + Mod 10)
2
3MSI1110 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
8import { barcode } from '@stacksjs/qrx'
9
10barcode('#barcode', '1234', { format: 'MSI1110' }) // Result: 123430
11```
12
13[!NOTE] Image needed: Basic MSI1110 barcode example
14
15## Combined Checksum Calculation
16
17The checksum calculation happens in two stages:
18
191. 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
232. Mod 10 check digit calculation
24 - Add Mod 11 check digit to data
25 - Apply Mod 10 algorithm
26 - Calculate final check digit
27
28Example:
29
30```
31Data: 1234
32Mod 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
38Mod 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
43Final Result: 123430
44```
45
46## Advanced Options
47
48```ts
49import { barcode } from '@stacksjs/qrx'
50
51barcode('#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
69import { barcode } from '@stacksjs/qrx'
70
71barcode('#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
841. **High-Security Environments**
85 - Pharmaceutical tracking
86 - Medical supplies
87 - Secure inventory
88
892. **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
981. **Input Validation**
99 - Verify numeric-only input
100 - Check maximum length
101 - Validate both checksums
102
1032. **Implementation**
104 - Test scanner compatibility
105 - Verify both algorithms
106 - Maintain adequate quiet zones
107
1083. **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
126MSI1110 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
139barcode('#barcode', '1234', { format: 'MSI10' }) // Basic
140barcode('#barcode', '1234', { format: 'MSI11' }) // Better
141barcode('#barcode', '1234', { format: 'MSI1010' }) // Enhanced
142barcode('#barcode', '1234', { format: 'MSI1110' }) // Maximum
143
144// Alternative for space-constrained applications
145barcode('#barcode', '1234', { format: 'MSI11' }) // Single check, good detection
146```
147
148## Technical Notes
149
1501. **Validation Process**
151 - Two-step verification
152 - Different algorithms
153 - Maximum detection capability
154
1552. **Scanner Requirements**
156 - Must support dual checksums
157 - Configuration verification
158 - Testing recommended
159
1603. **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
docs/api/barcode/MSI/index.mdadded+150-0
Changes to docs/api/barcode/MSI/index.md
@@ -0,0 +1,150 @@
1# MSI Barcode
2
3MSI _(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
8import { barcode } from '@stacksjs/qrx'
9
10barcode('#barcode', '123456789', {
11 format: 'MSI'
12})
13```
14
15![MSI Barcode](http://i.imgur.com/cm4ZQpE.png)
16
17## Available Variants
18
19qrx supports multiple MSI variants with different checksum calculations:
20
21```ts
22// Basic MSI (no checksum)
23barcode('#barcode', '1234', { format: 'MSI' }) // Result: 1234
24
25// With Mod 10 checksum
26barcode('#barcode', '1234', { format: 'MSI10' }) // Result: 12344
27
28// With Mod 11 checksum
29barcode('#barcode', '1234', { format: 'MSI11' }) // Result: 12343
30
31// With double Mod 10 checksum
32barcode('#barcode', '1234', { format: 'MSI1010' }) // Result: 123448
33
34// With Mod 11 & Mod 10 checksum
35barcode('#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
43import { barcode } from '@stacksjs/qrx'
44
45barcode('#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
621. **Retail**
63 - Shelf marking
64 - Price labels
65 - Inventory tags
66
672. **Warehouse**
68 - Location marking
69 - Bin labels
70 - Storage containers
71
723. **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
82import { barcode } from '@stacksjs/qrx'
83
84barcode('#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
971. **Character Set**
98 - Numeric only (0-9)
99 - Variable length
100 - Optional checksums
101
1022. **Structure**
103 - Start character
104 - Data digits
105 - Optional check digit(s)
106 - Stop character
107
1083. **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
1161. **Checksum Selection**
117 - Use MSI10 for basic error detection
118 - Use MSI1010 for enhanced reliability
119 - Use MSI1110 for maximum security
120
1212. **Implementation Guidelines**
122 - Validate numeric input
123 - Consider scanner compatibility
124 - Test checksum verification
125
1263. **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
135If transitioning from MSI to modern formats:
136
137```ts
138// Current MSI implementation
139barcode('#barcode', '123456789', { format: 'MSI' })
140
141// Modern alternative (CODE128)
142barcode('#barcode', '123456789', { format: 'CODE128' })
143```
144
145For 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)