This library provides tools for Finnish personal identity codes HETU (henkilötunnus) ans SATU (sähköinen asiointitunnus).
Features
- Validate HETU and SATU identity codes.
- Check gender of a HETU code.
- Generate random codes.
See https://dvv.fi/en/personal-identity-code
Apache Maven
<dependency>
<groupId>com.github.mpolla</groupId>
<artifactId>fin-id-utils</artifactId>
<version>0.5.4</version>
</dependency>
Gradle Kotlin DSL
implementation("com.github.mpolla:fin-id-utils:0.5.4")
Gradle Groovy DSL
implementation 'com.github.mpolla:fin-id-utils:0.5.4'
Validate a HETU/SATU code.
boolean validHetu = HetuUtil.isValid("131052+308T");
boolean validSatu = SatuUtil.isValid("10011187H");
Check the gender of a HETU code.
boolean isFemale = HetuUtil.isFemale("131052-308T");
Generate random HETU/SATU code.
String randomHetu = HetuUtil.generateRandom();
String randomSatu = SatuUtil.generateRandom();
Compute the control character suffix for a HETU code.
Char controlCharacter = HetuUtil.computeControlCharacter("131052-308");
Validate a HETU/SATU code.
val validHetu = HetuUtil.isValid("131052+308T")
val validSatu = SatuUtil.isValid("10011187H")
Check the gender of a HETU code.
val isFemale = HetuUtil.isFemale("131052-308T")
Generate random HETU/SATU code.
val randomHetu = HetuUtil.generateRandom()
val randomSatu = SatuUtil.generateRandom()
Compute the control character suffix for a HETU code.
val controlCharacter = HetuUtil.computeControlCharacter("131052-308")
Publish new release
git tag x.x
./gradlew publish