The mock-jutsu library provides a comprehensive suite of tools for generating localised identifiers, with the hr_oib function serving as a cornerstone for developers working on Croatian software projects. This function is specifically designed to generate a valid Croatian OIB (Osobni identifikacijski broj), which is the standard personal identification number used for citizens and legal entities in Croatia. By producing a precise 11-digit sequence, the library ensures that every generated value adheres to the strict formatting rules required for official identification, making it an indispensable asset for creating high-quality mock data.
Technically, the hr_oib function is built upon the ISO 7064 MOD 11,10 check digit algorithm. This sophisticated mathematical validation is essential because simple random number generation is insufficient for bypassing modern system validations that check for internal consistency. When using mock-jutsu to create test data, developers can be confident that the generated OIBs will pass through any front-end or back-end validation logic that relies on this specific checksum standard. This level of accuracy is vital for maintaining data integrity during the development of financial, governmental, or healthcare applications where incorrect ID formats could cause systemic failures.
Incorporating hr_oib into a development workflow is seamless across various environments. Whether you are performing a quick check via the command line with "mockjutsu generate hr_oib", integrating it directly into a Python script using "jutsu.generate('hr_oib')", or conducting performance testing in Apache JMeter using the "${__mockjutsu(hr_oib,)}" syntax, the output remains consistent and reliable. This multi-platform flexibility allows teams to populate databases with realistic test data quickly, significantly reducing the time spent on manual data entry and minimising the risk of using sensitive, real-world information in non-production environments.
For quality assurance professionals, the hr_oib function provides a dependable way to simulate diverse user profiles and edge cases. It is particularly useful for stress-testing registration forms, verifying database indexing for unique identifiers, and ensuring that API endpoints handle identification fields correctly. By leveraging mock-jutsu, developers can automate the creation of mock data that mimics real-world scenarios, leading to more resilient and compliant software solutions. This streamlined approach to data generation empowers teams to focus on core logic while ensuring their applications are fully prepared for the intricacies of regional data standards.
mockjutsu generate hr_oibmockjutsu bulk hr_oib --count 10mockjutsu export hr_oib --count 10 --format jsonmockjutsu export hr_oib --count 10 --format csvmockjutsu export hr_oib --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate hr_oib --maskmockjutsu bulk hr_oib --count 5 --maskfrom mockjutsu import jutsujutsu.generate('hr_oib')jutsu.bulk('hr_oib', count=10)jutsu.template(['hr_oib'], count=5)# mask=True: regulation-compliant outputjutsu.generate('hr_oib', mask=True)jutsu.bulk('hr_oib', count=5, mask=True)${__mockjutsu_intl_ids(hr_oib)}# JMeter Function: __mockjutsu_intl_ids# Parameter 1: hr_oib# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_intl_ids(hr_oib,mask)}GET /generate/hr_oib# → {"type":"hr_oib","result":"...","status":"ok"}GET /bulk/hr_oib?count=10POST /template {"types":["hr_oib"],"count":1}# mask=true: regulation-compliant outputGET /generate/hr_oib?mask=trueGET /bulk/hr_oib?count=5&mask=true| Parameter | Values | Description |
|---|---|---|
| --mask | true | false | Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…) |