Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

mod10-check-digit

tiaanduplessis3.6kMIT1.0.0

Calculate the check digit(mod10 algorithm)

mod10, Luhn, check-digit, checksum, mod10-check-digit, Luhn algorithm, Luhn formula

readme

mod10-check-digit

Calculate the check digit(mod10 algorithm)



Built with ❤︎ by Tiaan and contributors

Table of Contents

<summary>Table of Contents</summary>
  • 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.