× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I've been going back and forth on my Modulus10 routine because, as it turns
are the seems to be a variance in the way IBM does it and the LUHN formula.

The biggest issue is a subtle one but it is as follows,

With IBM, you always start with the left most digit (highest order digit)
and selects every even position digit, moving to the right and multiples it
by two.

This seems to be done regardless of the length of the original number;
ttherefore,  34567 would use 3, 5 and 7, and 4567 would use 4 and 6.

But the LUHN Modulus 10 formula begins with the rightmost digit (lowest
order digit) and selects every other digit moving to the left, and multiples
it by two.

 

So with IBM we would get this (starting on the left):

Start with:  3456

Step 1:  Multiple 3 and 5 by 2 =  6 10 

Step 2: Add them:  6 + 4 + 1 + 0 + 6  = 17

Step 3:  20 - 17 = 3

Check Digit = 3

   3456-3

 

But with the LUHN formula we would get this:

Start with 3456

Step 1: Multiple 4 and 6 by 2 = 12 and 8

Step 2: Add them:  3 + 8 + 5 + 1 + 2 = 19

Step 3:  20 - 19 = 1

Check Digit = 1

  3456-1

 

So is the IBM one screwy or are there two of them?

 

-Bob Cozzi

 

 


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.