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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.