Skip to content

Instantly share code, notes, and snippets.

Avatar

Giovanni Thenstead thensg

  • NYC
View GitHub Profile
@thensg
thensg / luhn-checksum.js
Last active Jan 6, 2020
Calculate or verify a Luhn (Mod10) checksum
View luhn-checksum.js
/**
* Calculate a Luhn (Mod10) checksum
* -or-
* Verify the Luhn checksum of a credit card or IMEI number
*
* This implementation was adapted from the following sources:
* - https://en.wikipedia.org/w/index.php?title=Luhn_algorithm&oldid=688221366
* - https://gist.github.com/ShirtlessKirk/2134376
*/
You can’t perform that action at this time.