in reply to Re: Faster Luhn Check Digit Calculation?
in thread Faster Luhn Check Digit Calculation?
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 ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Faster Luhn Check Digit Calculation?
by BrowserUk (Patriarch) on Dec 01, 2018 at 02:12 UTC | |
by BrowserUk (Patriarch) on Dec 01, 2018 at 02:54 UTC | |
by BrowserUk (Patriarch) on Dec 01, 2018 at 07:31 UTC | |
by kschwab (Vicar) on Dec 01, 2018 at 15:24 UTC | |
by BrowserUk (Patriarch) on Dec 01, 2018 at 20:19 UTC | |
by tybalt89 (Monsignor) on Dec 02, 2018 at 05:16 UTC | |
|