simple generate serial number library.
use Luhn algorithm when generate a serial number.
(for avoiding a user mistake input this)
install via npm
npm install generate-serial-number
var generator = require('generate-serial-number');
var serialNumber = generator.generate(10); // '8380289275'
get check check sum from an argument. use Luhn algorithm.
generate serial number(but, return value type is string ). length
is generate number string length.
The generated number is created by random value that length-1
and a check sum.
e.g) When a return value '8380289275'
, 838028927
is random value. and 5
which last number is check sum.
validte the checkNumber.
License under the MIT license.