@prm/luhn
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

@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

Readme

Keywords

none

Package Sidebar

Install

npm i @prm/luhn

Weekly Downloads

6

Version

0.1.5

License

GPL-3.0-or-later

Unpacked Size

39 kB

Total Files

6

Last publish

Collaborators

  • htunnicliff