Skip Menu |

This queue is for tickets about the Algorithm-LUHN CPAN distribution.

Report information
The Basics
Id: 43842
Status: resolved
Priority: 0/
Queue: Algorithm-LUHN

Owner: NEILB [...]
Requestors: joe.bruni [...]

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.01

Subject: documentation problem
Date: Wed, 4 Mar 2009 10:45:38 -0700
To: bug-Algorithm-LUHN [...]
From: Joseph Bruni <joe.bruni [...]>
Download (untitled) / with headers
text/plain 544b
I believe the documentation for is_valid() is wrong. I don't think you should be appending the calculated check digit to the string prior to calling is_valid(). As written, the example will always succeed regardless of the input. If one is just testing externally supplied numbers (e.g. CC numbers) for validity, it appears that only the CC number needs to be passed to is_valid(). The check digit has already been appended. The check_digit() call would only be useful to create numbers that would pass the is_valid() test. Joe
Download smime.p7s
application/pkcs7-signature 2.4k

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 127b
I've clarified this bit of the documentation, and added example usage with both valid and invalid card numbers. Thanks, Neil

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to