UNPKG

luhn-generator

Version:

A generator of numbers that passes the validation of Luhn algorithm or Luhn formula, also known as the 'modulus 10' or 'mod 10' algorithm

11 lines (9 loc) 332 B
// https://rwaldron.github.io/proposal-math-extensions/ var $export = require('./_export'); var scale = require('./_math-scale'); var fround = require('./_math-fround'); $export($export.S, 'Math', { fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { return fround(scale(x, inLow, inHigh, outLow, outHigh)); } });