Implementation of the Luhn checksum algorithm, see http://en.wikipedia.org/wiki/Luhn_algorithm
First argument should be a number or a string composed of digits only. Second argument is optional. If second argument evaluates to true, the return value is the concatenation of the first argument and its Luhn checksum. Otherwise the return value is a boolean indicating if the first arguments checksum digit is valid.
However, I found that your version has some problems.
For example, testing
4111111111111111
should be true, you version says false.