za_idnrIntlIDs

Mock Jutsu HOW-TO | EN

The za_idnr function within the mock-jutsu library provides developers with a reliable way to generate high-quality South African Identity Numbers (IDNR) for rigorous software evaluation. As a critical component of the IntlIDs category, this tool ensures that software engineers can produce realistic test data that adheres to the strict 13-digit format mandated by the South African Department of Home Affairs. By utilizing mock-jutsu, development teams can effectively avoid the security risks and ethical dilemmas associated with using real personal information while maintaining the functional integrity of their testing environments.

Every identifier generated by the za_idnr function is constructed using a precise internal algorithm to ensure it passes standard validation logic. The first six digits represent the individual's birth date in the YYMMDD format, followed by four digits indicating gender, a single digit for citizenship status, and an additional digit formerly used for racial classification. Most importantly, the final digit is a checksum calculated via the Luhn algorithm. This level of technical detail in the mock data allows developers to test complex validation routines, ensuring that their applications correctly parse age, gender, and checksum integrity without needing manual data entry or external verification services.

Integrating za_idnr into a modern development workflow is seamless across various environments. Python developers can simply call jutsu.generate('za_idnr') to programmatically fetch a value, while those working with command-line interfaces can use mockjutsu generate za_idnr for quick data retrieval during scripting. Additionally, the library supports performance testing through its JMeter integration using the ${__mockjutsu(za_idnr,)} syntax. This versatility makes it an essential asset for building robust Know Your Customer (KYC) workflows, financial services applications, and government-facing registration forms that require localized South African data.

Beyond simple generation, using mock-jutsu for South African IDs offers significant benefits in terms of regulatory compliance and development speed. It eliminates the need for sensitive production data in staging environments, helping organizations adhere to POPIA (Protection of Personal Information Act) requirements. Whether you are debugging a database schema or running large-scale load tests, the za_idnr function provides the accuracy and scale necessary to ensure your application is ready for the South African market. By automating the creation of valid test data, developers can focus on refining core logic rather than manually formatting complex strings.

CLI Usage
mockjutsu generate za_idnrmockjutsu bulk za_idnr --count 10mockjutsu export za_idnr --count 10 --format jsonmockjutsu export za_idnr --count 10 --format csvmockjutsu export za_idnr --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate za_idnr --maskmockjutsu bulk za_idnr --count 5 --mask
Python API
from mockjutsu import jutsujutsu.generate('za_idnr')jutsu.bulk('za_idnr', count=10)jutsu.template(['za_idnr'], count=5)# mask=True: regulation-compliant outputjutsu.generate('za_idnr', mask=True)jutsu.bulk('za_idnr', count=5, mask=True)
JMeter
${__mockjutsu_intl_ids(za_idnr)}# JMeter Function: __mockjutsu_intl_ids# Parameter 1: za_idnr# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_intl_ids(za_idnr,mask)}
REST API
GET /generate/za_idnr# → {"type":"za_idnr","result":"...","status":"ok"}GET /bulk/za_idnr?count=10POST /template {"types":["za_idnr"],"count":1}# mask=true: regulation-compliant outputGET /generate/za_idnr?mask=trueGET /bulk/za_idnr?count=5&mask=true

Parameters

Parameter Values Description
--mask true | false Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…)

Other Languages