Skip to content

gmitrev/egnclj

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
doc
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Egn

EGN(ЕГН) is the national identification number of Bulgarian citizens. This clojure library is designed to validate and parse such numbers.

Installation

With Leiningen:

[egn "0.1.0"]

With Maven:

<dependency>
  <groupId>egn</groupId>
  <artifactId>egn</artifactId>
  <version>0.1.0</version>
</dependency>

Usage

(require '[egn.core :as egn]))

; Validate numbers
(egn/validate "7104041555")
=> true

(egn/validate "7194041555")
=> false

; Parse them for information
(egn/parse "7104041555")
=> {:birth-date #<DateTime 1971-04-04T00:00:00.000Z> :gender :female}

(:gender (egn/parse "9509209819"))
=> :female

(:birth-date (egn/parse "9509209819"))
=> #<DateTime 1995-09-20T00:00:00.000Z>

License

Copyright © 2015 Georgi Mitrev

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

Generator, validator and parser for EGN(ЕГН) numbers

Resources

License

Stars

Watchers

Forks

Packages

No packages published