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

19 lines (15 loc) 362 B
(function () { "use strict"; var atob = require('.'); var encoded = "SGVsbG8sIFdvcmxkIQ==" var unencoded = "Hello, World!"; /* , encoded = "SGVsbG8sIBZM" , unencoded = "Hello, 世界" */ if (unencoded !== atob(encoded)) { console.log('[FAIL]', unencoded, atob(encoded)); return; } console.log('[PASS] all tests pass'); }());