Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 825 Bytes

README.md

File metadata and controls

31 lines (21 loc) · 825 Bytes

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