Timeline for The Luhn algorithm for verifying credit card numbers, etc
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
S Apr 7, 2012 at 15:41 | history | suggested | svinja | CC BY-SA 3.0 |
Unable to add a comment (I don't see the link for it)
|
Apr 3, 2012 at 12:13 | review | Suggested edits | |||
S Apr 7, 2012 at 15:41 | |||||
Feb 2, 2011 at 1:59 | comment | added | mootinator |
Turns out I did have the result of i%2<1?1:2 backwards. Thanks.
|
|
Feb 2, 2011 at 1:58 | history | edited | mootinator | CC BY-SA 2.5 |
Fixed error in logic
|
Feb 2, 2011 at 1:37 | comment | added | mootinator | I only tested one of my credit cards and a few off by one errors from it TBH. (Using the VS 2008 debugger) The algorithm is supposed to double every second digit starting with the LAST digit. If I didn't reverse the string, it would be incorrect for strings with odd lengths. | |
Feb 1, 2011 at 23:48 | comment | added | Nellius | It's a good idea, and an interesting approach, but it doesn't appear to work. At least not with my few tests. It looks like the "i" in your first lambda is supposed to be the index of the character in the string. Does that work as it should? If so, why do you reverse the string only to then modify it based on index position? Seems a bit redundant, no? | |
Jan 28, 2011 at 7:15 | history | edited | mootinator | CC BY-SA 2.5 |
Okay, now I'm happy.
|
Jan 28, 2011 at 7:03 | history | edited | mootinator | CC BY-SA 2.5 |
removed some whitespace, oops.
|
Jan 28, 2011 at 6:54 | history | answered | mootinator | CC BY-SA 2.5 |