th_pinIntlIDs

Mock Jutsu HOW-TO | EN

The th_pin function is a specialized utility within the mock-jutsu library designed to generate authentic-looking Thai Personal Identification Numbers. As a key component of the IntlIDs category, this function is essential for developers and QA engineers building applications tailored for the Thai market. Each generated value follows the official 13-digit format used by the Thai government for citizen and resident identification. By automating the creation of these identifiers, mock-jutsu enables development teams to populate databases and user interfaces with realistic mock data, ensuring that privacy is maintained by avoiding the use of actual sensitive information during the development lifecycle.

Technical accuracy is at the core of the th_pin generator, as it strictly adheres to the official MOD-11 checksum algorithm. This mathematical validation ensures that every ID produced by the library passes standard validation logic typically found in front-end forms and back-end verification services. The thirteenth digit serves as a check bit, calculated based on a weighted sum of the preceding twelve digits. By implementing this specific logic, mock-jutsu ensures that your test data is not merely a random sequence of numbers but a technically compliant representation that facilitates rigorous testing of data entry modules, validation scripts, and database integrity constraints.

For software professionals, the th_pin function supports a wide array of testing scenarios. It is particularly useful when performing stress tests on registration portals or verifying the Know Your Customer (KYC) workflows in fintech and e-commerce applications. Having access to valid Thai IDs allows for the seamless testing of search functionalities, filtering logic, and third-party API integrations that require standardized ID formats. This high-fidelity mock data helps teams identify edge cases early, such as ensuring the user interface correctly handles 13-digit inputs or verifying that the database schema properly indexes these unique identifiers without performance degradation.

One of the primary developer benefits of mock-jutsu is its cross-platform versatility. You can quickly generate a single ID via the command line using mockjutsu generate th_pin, or integrate it directly into automated test suites using the Python call jutsu.generate('th_pin'). Furthermore, for performance and load testing, the library provides a dedicated JMeter function, ${__mockjutsu(th_pin,)}, allowing for high-volume data simulation. This multi-interface approach significantly reduces the time spent on manual data preparation, allowing engineers to focus on building robust features while maintaining the highest standards for internationalized test data accuracy.

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

Parameters

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

Other Languages