Validate Swedish personal identity numbers
// readme
Personnummer
Validate Swedish personal identity numbers.
Installation
Add the package to your maven or gradle configuration.
If you prefer to use the package from github rather than maven-central,
add the repository as well.
<dependency>
<groupId>dev.personnummer</groupId>
<artifactId>personnummer</artifactId>
<version>3.*.*</version>
</dependency>
plugins {
id 'maven'
}
repositories {
// If using maven central
mavenCentral()
// If you wish to use github
maven {
url "https://github.com/personnummer/java:personnummer"
}
}
dependencies {
configuration("dev.personnummer:personnummer")
}
For more information on how to install and authenticate with github packages, check this link.
Examples
Validation
import dev.personnummer.*;
class Test
{
public void TestValidation()
{
Personnummer.valid("191212121212"); // => True
Personnummer.valid("121212+1212"); // => True
Personnummer.valid("20121212-1212"); // => True
}
}
```…