Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: (dkubb) Re: (4) YAL10CI (Yet Another LUHN-10 Checksum Implementation)

by johannz (Hermit)
on Mar 14, 2001 at 01:33 UTC ( [id://64222]=note: print w/replies, xml ) Need Help??


in reply to (dkubb) Re: (4) YAL10CI (Yet Another LUHN-10 Checksum Implementation)
in thread YAL10CI (Yet Another LUHN-10 Checksum Implementation)

Running this under -w gives warnings on odd lengths for $number. You can shut them up with only a little slowdown with the following:

sub dkubb_LUHN10_2 { my $number = shift || return 0; my $sum; $sum += (chop($number) || 0) + $LUHN10_map[chop($number) || 0] while "$number"; ($sum % 10 == 0) || 0; }
  • Comment on Re: (dkubb) Re: (4) YAL10CI (Yet Another LUHN-10 Checksum Implementation)
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://64222]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-18 19:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found