kargo icon indicating copy to clipboard operation
kargo copied to clipboard

check digit calculation

Open rtphokie opened this issue 5 years ago • 0 comments

Perhaps it's my unfamiliarity with Go, but I'm seeing two small errors in how the check digit is calculated.

Comparing the code in ups.go to the algorithm described here, it appears that line 55 should subtract 48 instead of 3 from the ascii value of the character.

Line 63 should also be enclosed in an else. As it stands the running sum of calculations for characters in the odd position also includes characters in the even position as well.

rtphokie avatar Nov 28 '20 18:11 rtphokie