Giter Club home page Giter Club logo

luhn-validation's Introduction


A full TypeScript EAN, UPC, IMEI, EID, ISBN & card validation tool

A quick and useful TypeScript package verify whether the EAN, UPC, IMEI, EID, ISBN, and card is valid or not, it uses Luhn algorithm validation method.

Luhn algorithm also known as the modulus 10 or mod 10 algorithm, is a simple checksum formula used to validate a variety of identification numbers.

๐Ÿš€ Technologies

This project was built using the following technologies:

๐Ÿ’ป Installation

To add this package to your project, simply execute the following command:

Remind: You must be on your project root directory

$ npm install luhn-validation

๐Ÿ”Ž Usage

$ import { imei } from 'luhn-validation';

Tip: Place your mouse pointer over the validate and you will have access to descriptions

Methods

  • ean (string | number)

    Validate EAN number

  • upc (string | number)

    Validate UPC number

  • imei (string | number)

    Validate IMEI number

  • eid (string)

    Validate EID number

  • isbn (string | number)

    Validate ISBN number

  • card (string | number)

    Validate credit/debit card number

๐Ÿ“ Example

If you want to check if an IMEI is valid or not, do the following:

$ import { imei } from 'luhn-validation';
// validate function returns a boolean

console.log(imei(868241056923981))
//boolean result

๐Ÿ‘ Contributing

Contributions are what make this platform an amazing place to learn, inspire, and create. Please feel free to visit the open issues section to propose or create a related issue.

๐Ÿ“„ Licensing

This repository is MIT licensed, as found in the LICENSE file.

luhn-validation has no documentation, just this repo.

luhn-validation's People

Contributors

dependabot[bot] avatar kfbfarley avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

tbikeev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.