Ported to javascript in an HTML file, replaced Luhn check.