Luhn Generator
A generator of numbers that passes the validation of Luhn algorithm or Luhn formula, also known as the "modulus 10" or "mod 10" algorithm
npm install luhn-generator --save
Usage
- ECMAScript Harmony;luhn; // 000000000018
- CommonJS$ node> const luhn = ;> luhn; // 000000000018
- AMD<!-- amd.html -->
- Script Tag<!-- script-tag.html -->
Generate Luhn "check digit" for number 1
:
luhn; // 8luhn; // 5
Generate number that will pass Luhn algorithm validation:
luhn; // 18luhn; // 125luhn; // 00018
Generate random number that will pass Luhn algorithm validation:
luhn; // 6436204626980luhn; // 54833184596638864915195736286128781213916608803535luhn; // 00000000000000000000000000000000000004591785326079
Validate number with Luhn algorithm:
luhn; // falseluhn; // trueluhn; // true
To Do
- Add page with examples
- Add card number generation