in reply to YAL10CI (Yet Another LUHN-10 Checksum Implementation)
Your algorythm is very fast. Congratulations! I tried to come up with something close in speed to what you have, but I could not. Instead I will submit my attempt in the hopes that it might spawn off an idea for someone else:
sub dkubb_LUHN10 { my $number = shift; my $sum; ($sum += chop $number) ... ($sum += $LUHN10_map[chop $number]) while $number ne ''; ($sum % 10 == 0) || 0; }
Update: The last line was: $sum % 10 || 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (dkubb) Re: (2) YAL10CI (Yet Another LUHN-10 Checksum Implementation)
by johannz (Hermit) on Mar 12, 2001 at 22:58 UTC | |
by dkubb (Deacon) on Mar 13, 2001 at 10:09 UTC | |
by johannz (Hermit) on Mar 14, 2001 at 01:33 UTC |