The fi_hetu function is a specialized utility within the mock-jutsu library designed to generate authentic Finnish Personal Identity Codes, known as Henkilötunnus. In the realm of modern software development, accessing high-quality test data that mirrors specific regional standards is crucial for building robust, localized applications. By utilizing mock-jutsu, developers can instantly produce valid strings that follow the precise structure required by Finnish regulatory systems, ensuring that backend validation logic and frontend input masks function seamlessly without the need to handle sensitive, real-world information.
Every identifier generated by the fi_hetu function adheres to the strict DDMMYY-NNNC format. This includes the date of birth, a century marker—such as "+" for the 19th century, "-" for the 20th century, or "A" for the 21st century—an individual number, and a critical control character. A key feature of this function is its implementation of the official MOD-31 checksum algorithm. This mathematical validation ensures that every generated string is technically "valid" according to Finnish standards. This level of accuracy is essential when performing automated testing on systems that verify the mathematical integrity of an ID, as it prevents false negatives during the quality assurance process.
One of the primary benefits of the fi_hetu generator is its cross-platform accessibility. Whether you are working directly in a Python environment using the jutsu.generate('fi_hetu') command, executing quick batches via the CLI, or conducting complex performance testing in Apache JMeter with the ${__mockjutsu(fi_hetu,)} syntax, the library provides a consistent interface for obtaining mock data. This versatility allows engineering teams to maintain a unified data generation strategy across different stages of the DevOps pipeline, from initial local unit tests to large-scale integration and load testing scenarios.
Ultimately, integrating mock-jutsu into your development workflow eliminates the manual overhead of calculating complex checksums or searching for valid ID examples. It provides a safe, reliable way to populate databases and simulate user registration flows while maintaining strict compliance with data privacy regulations. By leveraging the fi_hetu function, developers can focus on core feature development rather than tedious data preparation, knowing that their test data is both syntactically correct and programmatically valid for any application targeting the Finnish market.
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…) |