GithubHelp home page GithubHelp logo

common_numbers's Introduction

###COMMON NUMBERS

Common Numbers are numbers verfied with Luhn Algoritm like ISBN, VIN

common_numbers gem simple verify this numbers. In first version gem is focused on Polish numbers like:

  • PESEL - (Polish ID Number)
  • NIP - (Polish Taxation Identification Number)
  • REGON - (Polish Company Identification Number)

but in near future will validate also:

  • ISBN
  • EAN
  • VIN

maybe something else :)

###Instalation:

gem install common_numbers

###Usage:

All numbers are in module CommonNumbers and have simple method valid?

require 'common_numbers'

CommonNumbers::Polish::Nip.new(nip_number).valid?
CommonNumbers::Polish::Pesel.new(pesel_number).valid?
CommonNumbers::Polish::Regon.new(regon_number).valid?

###Valid numbers:

####NIP

NIP is valid when has 11 digits witn optional '-' between

1234563218
123-456-32-18
123-45-63-218

are valid numbers

In international notation NIP has country code as first two signs, and:

PL1234563218
PL123-456-32-18
PL123-45-63-218

are also valid.

####PESEL

Pesel's valid format is 11 digits, no other signs

####REGON

Regon has two options, first 9 digits for small companies and 14 digits with companies with regional offices.

Both are validated.

Copyright (c) 2011 Mariusz Nosiński, released under the MIT license

common_numbers's People

Contributors

marioosh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.