Sha256: 113179cebaed46825983dfada0fec72e6f7ec717e458b6c69fe7242ab99eb755

Contents?: true

Size: 1.27 KB

Versions: 1

Compression:

Stored size: 1.27 KB

Contents

###MAGICK NUMBERS

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

magick_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

meybe something else :)

###Instalation:

    gem install magick_numbers

###Usage:

All numbers are in module MagickNumbers and have simple method `valid?`

    require 'magick_numbers'
    
    MagickNumbers::Nip.new(nip_number).valid?
    MagickNumbers::Pesel.new(pesel_number).valid?
    MagickNumbers::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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
magick_numbers-0.1.4 README.markdown