The Luhn algorithm

Hi,

Can anyone help me how to create a java service to add a checksum using Luhn algorithm?
I want to add 2 digit checksum to my number.

example: 006244914 → 00624491411

I dont want to do this as a flow service.

/J

check this post:

I don’t think this is what I need. I like to add a checksum of 2 digits to my number using modulus 10.

Yes it is possible, do you mind sharing the algorithm in steps.

I see your input is 006244914 and output is suffixed by 11 i.e, 00624491411

Do you have logic behind this to generate the output as above.

Hi,

The logic is the luhn algorithm [u]http://en.wikipedia.org/wiki/Luhn_algorithm[/u] but with two digits as control, maybe this is the difficult part. I dont find an example of that.

If I understand it correctly, Luhn algorithm works only with one check digit. You are looking for extending the algorithm, not finding a way to code it.

What is your requirement? Is it something you are trying to validate the Credit card number or IEMI?