Skip to content

Easy and lightweight library for Pesel (Polish National Identification Number) validation.

License

Notifications You must be signed in to change notification settings

lukszar/PeselSwift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PeselSwift logo

Build passing Swift 3.0 Carthage compatible

PeselSwift

Easy and lightweight library for Pesel (Polish National Identification Number) validation.

How to use

You can add framework to your project manually, or ...

add framework using Carthage:

github "lukszar/PeselSwift"

Examples

Below look at examples you can use in your app.

Validate Pesel

  let pesel = Pesel(pesel: "XXXXXXXXXXX")
  let result = pesel.validate()
        
  switch result {
    
    case .success:
      print("success")
            
    case .error(let error):
      print("failure with error: \(error)")
  }

or

  let result = Pesel.validate(pesel: "XXXXXXXXXXX")
        
  switch result {
    
    case .success:
      print("success")
            
    case .error(let error):
      print("failure with error: \(error)")
  }

Get birth date from pesel

let pesel = Pesel(pesel: "XXXXXXXXXXX")
let date = pesel.birthdate()
print(date)

App demo

Download demo app to see examples of usage.

Screenshot from application

About

Easy and lightweight library for Pesel (Polish National Identification Number) validation.

Resources

License

Stars

Watchers

Forks

Packages

No packages published