mod10-check-digit

Calculate the check digit(mod10 algorithm)

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
mod10-check-digit
201.0.07 years ago7 years agoMinified + gzip package size for mod10-check-digit in KB

Readme

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" />
Downloads
<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" />


Built with ❤︎ by Tiaan and contributors

Table of Contents

Table of Contents
  • Install
  • Usage
  • CLI
  • Contribute
  • License
  • Install

    $ npm install --save mod10-check-digit
    # OR
    $ yarn add mod10-check-digit

    Usage

    Module exports a single function that takes a number string 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.

    License

    Licensed under the MIT License.