Coder Social home page Coder Social logo

yannliang / verified Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zeevallin/verified

0.0 2.0 0.0 168 KB

A simple Ruby Gem to verify MRZ codes on passports. Useful if you need to meet KYC or Money Laundering requirements.

Ruby 100.00%

verified's Introduction

Verified

A simple Ruby Gem to verify and parse MRZ codes on passports. Useful if you need to meet KYC or Money Laundering requirements.

Examples

Setup a new instance

passport = Verified::Passport.new("P<GBRLAST<<FIRST<MIDDLE<LION<<<<<<<<<<<<<<<<", "1234567897GBR0001018M1001015<<<<<<<<<<<<<<00")

Now use it like this:

passport.verified?
# => true
passport.LastName
# => LAST
passport.Gender
# => M

Full Usage Documentation

Verified is used as above in the examples. It takes two arguments:

mrzLine1: The first line of a Passport MRZ (the long strip of text on the bottom). (string, required)
mrzLine2: The second line of a Passport MRZ (the long strip of text on the bottom). (string, required)

It then can be called using any of the folllowing methods:

verified? : Returns true if it's a valid passport MRZ, false if it's not.
IssuingState : Issuing country of the passport
LastName : Last name on the passport
FirstNames : Array of first names on the passport (First and any middle names)
Number : Passport Number
Nationality : Nationality of the person on the passport. Different from the issuing state (eg. Swedish person who is also a citizen of UK.)
DateOfBirth : Date of Birth, given as a Ruby Date object.
Gender : Gender, given as M, F or nil if not specified.
ExpiryDate : Expiy date of the passport, given as a Ruby Date object.
PersonalNumber : Personal number, if chosen to be given by issuer. Nil if not specified.

Installation

Verified is installed as a ruby gem

gem install verified

Or add it to your project Gemfile

gem "verified", "~> 1.1.0"

License and Credit

Released under the MIT license for free usage with no warranty.

Based on Document 9303 (Machine Readable Travel Documents - Part 1 - Machine Readable Passports. Volume 1 - Passports with Machine Readable Data Stored in Optical Character Recognition format) by the ICAO which can be found here: http://www.icao.int/publications/pages/publication.aspx?docnum=9303

WARNING: THE ALGORITHM TO GENERATE VALID CHECK DIGITS ON MRZ'S IS PUBLIC. BY USING VERIFIED YOU UNDERSTAND THIS CANNOT CONFIRM THE VALID ISSUE OF A PASSPORT, BUT CAN CONFIRM IT WOULD BE AS THE ISSUE OF A VALID PASSPORT. USE THIS AS AN AID TO KYC BUT NOT AS A COMPLETE SOLUTION.

verified's People

Watchers

Yann avatar James Cloos 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.