# lib-mod10

> A module for checking numbers against luhn algorithm

Latest version **1.2.2** (published 2019-06-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install lib-mod10
pnpm add lib-mod10
yarn add lib-mod10
bun add lib-mod10
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2019-06-18 |
| First published | 2019-06-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Tim Beard |
| Maintainers | timbeard |
| Keywords | node, mod10, luhn, formula, check, sum, checksum, math, modulus, modulo, number, security |

## Links

- npm: https://www.npmjs.com/package/lib-mod10
- Repository: https://github.com/TimBeard/lib-mod10
- npm.io page: https://npm.io/package/lib-mod10

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 1.2.2 (latest) — 2019-06-18
- 1.2.1 — 2019-06-18
- 1.2.0 — 2019-06-11

## README

# lib-mod10
A node module for checking numbers against luhn algorithm

## Installation
```
yarn add lib-mod10
```

## Usage
The library exposes two methods:
- compute() => Compute checksum for input number
- check() => Checks input number against luhn algorithm

### Compute
```javascript
// Import lib-mod10
import Mod10 from 'lib-mod10'

// Compute checksum for a random number
const cheksum = Mod10.compute('1234567890') // Should output 3
```

### Check
```javascript
// Import lib-mod10
import Mod10 from 'lib-mod10'

// Check random number against luhn algorithm
const isValid = Mod10.check('12345678903') // Should output true
```

## Demo
You can try this module [on codepen](https://codepen.io/TimBeard/pen/WqNPQQ)

---
_Source: https://npm.io/package/lib-mod10 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
