Implementation of the Luhn 10 algorithm to check validity of credit card numbers. See http://en.wikipedia.org/wiki/Luhn_algorithm for details on the algorithm.
var validCreditCard = function(a,b,c,d,e){for(d=+a[b=a.length-1],e=0;b--;)c=+a[b],d+=++e%2?2*c%10+(c>4):c;return!(d%10)};
validCreditCard('378282246310005'); //=> true
validCreditCard('378282246310006'); //=> false
// some numbers to test with
// 378282246310005 371449635398431 378734493671000
// 30569309025904 38520000023237 6011111111111117
// 6011000990139424 5555555555554444 5105105105105100
// 4111111111111111 4012888888881881 4222222222222
Not sure if the MIT license is what you want. It's a little over a kilobyte and looks like it requires itself to be included in any JavaScript file containing your function.
What if you just called it public domain, attribution requested to either your name or this github URL?