Skip to content

Instantly share code, notes, and snippets.

Jon Bodner jonbodner

Block or report user

Report or block jonbodner

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ShirtlessKirk
ShirtlessKirk / luhn.js
Last active Nov 20, 2019
Luhn validation algorithm
View luhn.js
/**
* Luhn algorithm in JavaScript: validate credit card number supplied as string of numbers
* @author ShirtlessKirk. Copyright (c) 2012.
* @license WTFPL (http://www.wtfpl.net/txt/copying)
*/
var luhnChk = (function (arr) {
return function (ccNum) {
var
len = ccNum.length,
bit = 1,
You can’t perform that action at this time.