check-digit

Why is my ASCII char to int conversion failing?

早过忘川 提交于 2020-01-07 04:10:30
问题 According to the chart here: http://www.idautomation.com/barcode-faq/code-128/ This character: Ë equates to the value 103. Yet this code: string barcode = textBoxRawCode128.Text.Trim(); . . . int runningTotal = ConvertToASCIIInt(barCode[0]); . . . private int ConvertToASCIIInt(char valToConvertToASCII) { const int ASCII_ADJUSTMENT_VAL = 32; return valToConvertToASCII - ASCII_ADJUSTMENT_VAL; } ...when the value in the textbox and thus of barcode is "ËTry another string.", thus where barcode[0]

How to calculate checksum digit for EAN-14?

﹥>﹥吖頭↗ 提交于 2019-12-12 06:37:31
问题 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 EAN 14 for anything 14 long checkDigitSubtotal = (Val(Mid(Barcode, 2, 1))) _ + (Val(Mid(Barcode, 4, 1))) _ + (Val(Mid(Barcode, 6, 1))) _ + (Val(Mid(Barcode, 8, 1))) _ + (Val(Mid(Barcode, 10, 1))) _ + (Val(Mid(Barcode, 12, 1))) checkDigitSubtotal = (3 *

Generating Luhn Checksums

隐身守侯 提交于 2019-12-03 18:54:59
问题 There are lots of implementations for validating Luhn checksums but very few for generating them. I've come across this one however in my tests it has revealed to be buggy and I don't understand the logic behind the delta variable. I've made this function that supposedly should generated Luhn checksums but for some reason that I haven't yet understood the generated checksums are invalid half of the time. function Luhn($number, $iterations = 1) { while ($iterations-- >= 1) { $stack = 0;

Extending the Damm algorithm to base-32

元气小坏坏 提交于 2019-12-03 16:58:44
问题 I'd like to use the Damm algorithm to generate check digits for codes with a 32-character alphabet. The algorithm itself is easily applied to any base (except 2 or 6). The difficulty is the necessary look-up table, which must be a totally anti-symmetric quasigroup with a single character (usually 0) down the main diagonal. The Wikipedia page gives a table for base 10, and the Python implementation gives a table for base-16, but I haven't found a base-32 example. Does anyone have a suitable

Extending the Damm algorithm to base-32

我只是一个虾纸丫 提交于 2019-12-03 06:03:07
I'd like to use the Damm algorithm to generate check digits for codes with a 32-character alphabet. The algorithm itself is easily applied to any base (except 2 or 6). The difficulty is the necessary look-up table, which must be a totally anti-symmetric quasigroup with a single character (usually 0) down the main diagonal. The Wikipedia page gives a table for base 10, and the Python implementation gives a table for base-16 , but I haven't found a base-32 example. Does anyone have a suitable table for base-32? Inspired by David Eisenstat's answer (and the original dissertation by Damm that he