The fi_hetu function is a specialised component within the mock-jutsu library, designed specifically for developers and QA engineers who require authentic Finnish Personal Identity Codes for their application environments. Known locally as the Henkilötunnus (HETU), this unique identifier is essential for any software interacting with Finnish citizen data, such as banking applications, government portals, or healthcare systems. By providing high-quality mock data, mock-jutsu ensures that development teams can simulate realistic user profiles without compromising real-world privacy or security.
Technically, the fi_hetu generator adheres strictly to the Finnish national standard, producing a string in the format DDMMYY+/-NNNC. The first six digits represent the date of birth, followed by a century marker—typically a minus sign for the 1900s or the letter 'A' for the 2000s—and a three-digit individual number. Crucially, the function calculates the final character using the MOD-31 checksum algorithm. This level of precision is vital for bypassing front-end validation logic and ensuring that the test data is accepted by systems that perform rigorous integrity checks on Finnish identifiers.
Integration is seamless across various dev-ops workflows, whether you are using the command-line interface with the command mockjutsu generate fi_hetu or embedding it directly into Python scripts via jutsu.generate('fi_hetu'). For those conducting performance or load testing, the library also supports JMeter through the ${__mockjutsu(fi_hetu,)} syntax. This versatility allows developers to populate databases, test edge cases like leap-year birthdays, or verify that age-restricted features function correctly under different demographic scenarios without manual data entry.
Utilising fi_hetu within the mock-jutsu framework significantly reduces the manual overhead of creating valid test strings. It eliminates the risk of using real PII (Personally Identifiable Information), which is a critical consideration for GDPR compliance and data safety. By automating the generation of these complex identifiers, developers can focus on building robust features while maintaining a high standard of data integrity throughout the software development lifecycle. This makes mock-jutsu an indispensable tool for modern, data-driven engineering teams looking to streamline their testing pipelines.
mockjutsu generate fi_hetumockjutsu bulk fi_hetu --count 10mockjutsu export fi_hetu --count 10 --format jsonmockjutsu export fi_hetu --count 10 --format csvmockjutsu export fi_hetu --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate fi_hetu --maskmockjutsu bulk fi_hetu --count 5 --maskfrom mockjutsu import jutsujutsu.generate('fi_hetu')jutsu.bulk('fi_hetu', count=10)jutsu.template(['fi_hetu'], count=5)# mask=True: regulation-compliant outputjutsu.generate('fi_hetu', mask=True)jutsu.bulk('fi_hetu', count=5, mask=True)${__mockjutsu_intl_ids(fi_hetu)}# JMeter Function: __mockjutsu_intl_ids# Parameter 1: fi_hetu# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_intl_ids(fi_hetu,mask)}GET /generate/fi_hetu# → {"type":"fi_hetu","result":"...","status":"ok"}GET /bulk/fi_hetu?count=10POST /template {"types":["fi_hetu"],"count":1}# mask=true: regulation-compliant outputGET /generate/fi_hetu?mask=trueGET /bulk/fi_hetu?count=5&mask=true| Parameter | Values | Description |
|---|---|---|
| --mask | true | false | Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…) |