mod10-check-digit
Calculate the check digit(mod10 algorithm)
<img src="https://img.shields.io/npm/v/mod10-check-digit.svg?style=flat-square" alt="Package version" />
<img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square" alt="Standard" />
<img src="https://img.shields.io/travis/tiaanduplessis/mod10-check-digit.svg?style=flat-square" alt="Travis Build" />
<img src="https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square" alt="Standard Readme" />
<img src="https://badge.fury.io/gh/tiaanduplessis%2Fmod10-check-digit.svg?style=flat-square" alt="GitHub version" />
<img src="https://dependencyci.com/github/tiaanduplessis/mod10-check-digit/badge?style=flat-square" alt="Dependency CI" />
<img src="https://img.shields.io/npm/l/mod10-check-digit.svg?style=flat-square" alt="License" />
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square" alt="PRs" />
<img src="https://img.shields.io/badge/$-support-green.svg?style=flat-square" alt="Donate" />
<img src="https://img.shields.io/github/watchers/tiaanduplessis/mod10-check-digit.svg?style=social" alt="Github Watch Badge" />
<img src="https://img.shields.io/github/stars/tiaanduplessis/mod10-check-digit.svg?style=social" alt="Github Star Badge" />
<img src="https://img.shields.io/twitter/url/https/github.com/tiaanduplessis/mod10-check-digit.svg?style=social" alt="Tweet" />
Built with ❤︎ by Tiaan and contributors
Table of Contents
Table of ContentsInstall
$ npm install --save mod10-check-digit
# OR
$ yarn add mod10-check-digit
Usage
Module exports a single function that takes a numberstring
as argument and returns the check digit number
.const mod10CheckDigit = require('mod10-check-digit')
console.log(mod10CheckDigit('9202204720082')) // 2
console.log(mod10CheckDigit('7992739871')) // 3
console.log(mod10CheckDigit('7240157335352')) // 4
CLI
$ npm install --global mod10-check-digit
# OR
$ yarn global add mod10-check-digit
Then:
$ mod10-check-digit 9202204720082
# 2
Contribute
Contributions are welcome. Please open up an issue or create PR if you would like to help out.Note: If editing the README, please conform to the standard-readme specification.