Questions tagged [check-digit]

It is a single digit computed from the other digits in the message. With a check digit, one can detect errors from the input of a series of digits.

41 questions
1
vote
2 answers

How Do I Ensure a Candidate Latin Square Is a Valid Damm Operation Table

I am attempting to write a function in Scala that takes a valid Latin Square as input and then returns a Boolean value indicating whether the input Latin Square is a valid instance of an operation-table for the Damm Algorithm, or not. The Damm…
chaotic3quilibrium
  • 5,661
  • 8
  • 53
  • 86
1
vote
2 answers

How is a check digit calculation done in Ruby?

I'm trying to build a check-digit calculation in Ruby for FedEx tracking numbers. Here is info and the steps for the check-digit calculation: Digit positions are labeled from right to left. Digit 1 is the check character. Digits 16 through 22 are…
Shpigford
  • 24,748
  • 58
  • 163
  • 252
1
vote
3 answers

Efficient implementation of the GTIN-13 algorithm

I am looking for an efficient way to implement the GTIN-13 check digit algorithm. I have looked at some relevant SO posts such as this and this but it seems like efficiency was not the subject of attention in either case. Briefly, the algorithm…
Merik
  • 2,767
  • 6
  • 25
  • 41
1
vote
2 answers

I need to validate an input string using checksum for alphanumerics

I have the following function that validates a digits input consisted of only numbers based on Luhn Algorithm: function isCheckdigitCorrect(value) { // accept only digits, dashes or spaces if (/[^0-9-\s]+/.test(value)) return false; var nCheck…
pranvera hoti
  • 107
  • 3
  • 15
1
vote
1 answer

How can I get next check digit using luhn algorithm in javascript

I have the following code that validates if a certain digits is valid using luhn algorithm module 10. function isCheckdigitCorrect(value) { // accept only digits, dashes or spaces if (/[^0-9-\s]+/.test(value)) return false; var nCheck = 0,…
pranvera hoti
  • 107
  • 3
  • 15
1
vote
1 answer

Validate check digit 11 (mod 11) using PHP

How to validate NHS number using check digit 11 (mod 11) using PHP. After a long search on the internet trying to find a function that I can use to validate check digit 11 (mod 11) number, I couldn't find so I end up developing one myself and share…
Mohamed Mahyoub
  • 381
  • 2
  • 18
1
vote
1 answer

How to calculate a FedEx Smartpost tracking number' check digit

FedEx Ground's tracking numbers have different digits: 12, 15, 20, 22. 12-digits tracking numbers use mod 11 algorithm. Others use mod 10 algorithm. But recently I got some 20-digits FedEx Smartpost tracking numbers which can't identified by both…
liangping
  • 13
  • 1
  • 1
  • 5
0
votes
1 answer

Create check digit function

I'm trying to create check digits and append them after the original UPCs. Here's the sample data Because there are leading 0's, I have to read the data as strings first: import pandas as pd …
Nicole
  • 43
  • 6
0
votes
3 answers

USPS ACS Keyline Check Digit

I have implemented the "MOD 10" check digit algorithm using SQL, for the US Postal Service Address Change Service Keyline according to the method in their document, but it seems I'm getting the wrong numbers! Our input strings have only numbers in…
Jasmine
  • 4,003
  • 2
  • 29
  • 39
0
votes
4 answers

Invalid Token. Not accepting integers that start with 0

So I'm trying to make a check digit function, and embarrassingly, I've already run into a snag early on that I've been trying to search the problem for, but most of the explanations I've run into are unfortunately beyond my comprehension. I'm hoping…
0
votes
3 answers

How to calculate checksum digit for EAN-14?

I am trying to validate EAN 14 UPC code in vba access. I am trying to find it online but no luck. I just found for EAN 8 and EAN 13. So, I just tried to code it similar to EAN 13 as following: If Len(Barcode) = 14 Then 'do the check digit for…
toofaced
  • 141
  • 4
  • 18
0
votes
2 answers

My GTIN 8 check digit and validity check isn't working

My code supposed to ask for a 7 digit number (GTIN 8) and tell you the 8th digit and/or ask you for an 8 digit (GTIN 8) number and tell whether it's a valid GTIN 8 number. I am not getting these outputs though. ERROR message when I type in a not 7…
Clink
  • 3
  • 1
  • 4
0
votes
0 answers

OCR serial number check digit

I want to read a serial number of about 16-20 characters (A-Z, 0-9) with the help of OCR. Since all character won't be recognized correctly every time I want to add one check character to the serial number. At the moment I found the simple Luhn mod…
Mr.Sheep
  • 1,368
  • 1
  • 15
  • 32
0
votes
1 answer

How to implement the Damm algorithm for checksums and redundancy

Is anyone here aware of any textbooks or industry guides that provide a practical guide for an ordinary engineer (not a doctor of mathematics) to implement the Damm algorithm? Specifically I would like to know how the Latin squares are generated…
0
votes
1 answer

Is there a way to check digits of a CUSIP in Perl

My work place won't allow us to install any modules so that option isn't for me. So decided to look at this link http://en.wikipedia.org/wiki/CUSIP and follow the pseudocode there and attempt to code it in Perl. And i came up with the…
user2025696
  • 159
  • 1
  • 11