I've been looking to generate support ticket numbers with built-in error correction, so they can be discussed over the phone with customers.
Didn't find any off-the-shelf implementations in .NET so I gave up for the time being.
I might just end up adding a checksum to the ticket# and then computing all possible permutations that still meet the checksum, and verify each match against the database of open tickets. Takes less space anyway.
The EAN-13 standard is pretty close to what you need, giving single-digit error detection (tho not correction), and you can shorten it to the last 5 or 6 digits. As the last digit is the checksum, this gives you 4 or 5 digits of precision.
Back at my earlier workplace we used EAN-13s as product serial numbers. Generally in customer service we used the last 5 digits, with the leading ones being implied by product model.
This doesn't detect a transposition error, which is somewhat common with humans. That's why in EAN-13 and similar codes, the checksum takes digits with varying weights.
Didn't find any off-the-shelf implementations in .NET so I gave up for the time being.
I might just end up adding a checksum to the ticket# and then computing all possible permutations that still meet the checksum, and verify each match against the database of open tickets. Takes less space anyway.