Coder Social home page Coder Social logo

arietis / norwegianssn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hyperoslo/norwegianssn

0.0 2.0 0.0 160 KB

A convenient way of validating and extracting info from a Norwegian Social Security Number

Home Page: http://hyper.no

License: Other

Ruby 10.91% Swift 89.09%

norwegianssn's Introduction

#NorwegianSSN

A convenient way of validating and extracting info from a Norwegian Social Security Number

Reference http://www.kith.no/upload/5588/KITH1001-2010_Identifikatorer-for-personer_v1.pdf

let ssn = NorwegianSSN.init(ssn:"xxxxxxxxxxx")

if ssn.isValid() {
    NSLog(@"Yeap, this is valid alright, tell me more about this so called person.")
    self.gainInterest = true
}

if ssn.isDNumber() {
    println("OMG! A potential swede")
    self.runAndHide()
}

if !ssn.isMale() {
    println("Oh, it's a woman!")
    self.comesBack()
}

println("Are you sure? Remember what happened last time?")

if ssn.isFemale() {
    println("Yeah I'm sure, this is not an Aerosmith song!")
    self.startWhistlingOnTune("Aerosmith -  Dude (looks like a lady")
    println("Doh!")
}

if ssn.age() >= 18 && ssn.age() < 35 {
    println("Dear diary, jackpot")
    self.enableTheSmoulder = true
}

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Credits

Hyper made this. We're a digital communications agency with a passion for good code, and if you're using this library we probably want to hire you.

License

NorwegianSSN is available under the MIT license. See the LICENSE file for more info.

norwegianssn's People

Contributors

zenangst avatar

Watchers

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