0.1.5 • Published 5 years ago

@prm/luhn v0.1.5

Weekly downloads
4
License
GPL-3.0-or-later
Repository
github
Last release
5 years ago

@prm/luhn

A zero-dependency Node.js module for calculating a numeric check digit for alphanumeric strings. The exported luhn() function uses the Luhn algorithm to calculate a check digit based on an input string.

Usage

Node.js

const { luhn } = require("@prm/luhn")

luhn("Z2N 9Z3 F0 K3") // returns 2

SQL

SELECT luhn("1245496594") -- returns 3

Testing

npm run test
0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

6 years ago

0.1.2

6 years ago