Skip to content

Instantly share code, notes, and snippets.

View oPorks's full-sized avatar

Rafael Queiroz oPorks

View GitHub Profile
/**
* Variant of Avraham Plotnitzky's String.prototype method mixed with the "fast" version
* see: https://sites.google.com/site/abapexamples/javascript/luhn-validation
* @author ShirtlessKirk. Copyright (c) 2012.
* Licensed under WTFPL (http://www.wtfpl.net/txt/copying)
*/
function luhnChk(luhn) {
var len = luhn.length,
mul = 0,
/**
* Variant of Avraham Plotnitzky's String.prototype method mixed with the "fast" version
* see: https://sites.google.com/site/abapexamples/javascript/luhn-validation
* @author ShirtlessKirk. Copyright (c) 2012.
* Licensed under WTFPL (http://www.wtfpl.net/txt/copying)
*/
function luhnChk(luhn) {
var len = luhn.length,
mul = 0,