Validate Swedish personal identity numbers with Kotlin. Heavily inspired by the Java implementation by @Johannestegner, thank you!
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
.
This code is linted with ktlint. See
ktlint
documentation for details.
MIT