It is a little faster than my previous Perl attempts...
Benchmark: timing 100 iterations of BrowserUK, Inline::C, Algorithm::LUHN... BrowserUK: 46 wallclock secs (46.03 usr + 0.00 sys = 46.03 CPU) @ 2.17/s (n=100) Inline::C: 1 wallclock secs ( 1.28 usr + 0.00 sys = 1.28 CPU) @ 78.12/s (n=100) Algorithm::LUHN: 49 wallclock secs (48.58 usr + 0.00 sys = 48.58 CPU) @ 2.06/s (n=100)
But, it's not producing the right checksum digit. It should produce:
4011350000000008 4011350000000016 4011350000000024 4011350000000032 4011350000000040 4011350000000057 4011350000000065 4011350000000073 4011350000000081 4011350000000099 ...But, it's producing:
4011350000000000 4011350000000019 4011350000000028 4011350000000037 4011350000000046 4011350000000055 4011350000000064 4011350000000073 4011350000000082 4011350000000091 ...
In reply to Re^2: Faster Luhn Check Digit Calculation?
by kschwab
in thread Faster Luhn Check Digit Calculation?
by kschwab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |