luhn-generator-crypto
v1.0.2
Published
A modified version of the original luhn-generator (by rromanovsky) that uses cryptographic randomness (randomBytes) for secure randomness.
Maintainers
Readme
Cryptographic Luhn Generator
A generator of numbers (using cryptographic randomness function randomBytes) that passes the validation of Luhn algorithm or Luhn formula, also known as the "modulus 10" or "mod 10" algorithm
About
This package is a fork of luhn-generator.
It replaces Math.random() with crypto.randomBytes() for stronger randomness.
npm install luhn-generator-crypto --saveUsage
$ node
> import luhn from 'luhn-generator-crypto';
> luhn.generate(1, { pad: 12 }); // 000000000018