Skip to content

personnummer/kotlin

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

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

Personnummer

GitHub Workflow Status

Validate Swedish personal identity numbers with Kotlin. Heavily inspired by the Java implementation by @Johannestegner, thank you!

Example

import personnummer.Personnummer

fun main(args: Array<String>) {
    Personnummer.valid(8507099805L)     // => true
    Personnummer.valid("198507099805")  // => true
}

More examples in the src/test/kotlin/PersonnummerTest.kt.

Linting

This code is linted with ktlint. See ktlint documentation for details.

License

MIT