The sg_uen function within the mock-jutsu library is a specialized tool designed to generate realistic Singapore Unique Entity Numbers for various development and testing environments. In the Singaporean regulatory landscape, the UEN serves as a standard identification number for all registered entities, such as businesses, local companies, and representative offices. By utilizing this function, developers can produce high-quality mock data that adheres strictly to the official format, which typically consists of an eight-digit sequence followed by a checksum letter. This ensures that the generated test data remains consistent with real-world identification standards used by government agencies like ACRA.
At its core, the sg_uen generator employs the MOD-11 algorithm to calculate the final check digit, ensuring that every output is mathematically valid. This level of precision is critical for software applications that perform front-end or back-end validation on entity identifiers. When using mock-jutsu, engineers no longer need to manually craft valid numbers or bypass validation logic during the development lifecycle. Whether you are seeding a database for a fintech application or testing a KYC (Know Your Customer) workflow, the ability to generate valid mock data on demand significantly reduces the risk of integration errors and improves the overall reliability of the testing suite.
Flexibility is a core feature of mock-jutsu, and the sg_uen function is accessible through multiple interfaces to suit various development environments. For quick prototyping or shell scripting, the command-line interface allows users to execute "mockjutsu generate sg_uen" to receive instant output. Python developers can integrate the library directly into their test scripts using the "jutsu.generate('sg_uen')" method. Furthermore, performance testers can leverage the JMeter plugin by calling "${__mockjutsu(sg_uen,)}" to inject dynamic test data into high-concurrency load tests. This versatility ensures that regardless of the stack, your team has access to valid Singaporean entity identifiers.
Beyond simple generation, using the sg_uen function provides significant benefits in terms of compliance and data privacy. By using synthetic test data instead of actual business records, organizations can maintain strict adherence to data protection regulations like the PDPA. This approach allows QA teams to simulate complex business scenarios, such as bulk entity registration or tax reporting simulations, without compromising sensitive information. Ultimately, the sg_uen function in mock-jutsu empowers developers to build more robust, production-ready applications by providing a reliable source of localized international identifiers.
mockjutsu generate sg_uenmockjutsu bulk sg_uen --count 10mockjutsu export sg_uen --count 10 --format jsonmockjutsu export sg_uen --count 10 --format csvmockjutsu export sg_uen --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate sg_uen --maskmockjutsu bulk sg_uen --count 5 --maskfrom mockjutsu import jutsujutsu.generate('sg_uen')jutsu.bulk('sg_uen', count=10)jutsu.template(['sg_uen'], count=5)# mask=True: regulation-compliant outputjutsu.generate('sg_uen', mask=True)jutsu.bulk('sg_uen', count=5, mask=True)${__mockjutsu_intl_ids(sg_uen)}# JMeter Function: __mockjutsu_intl_ids# Parameter 1: sg_uen# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_intl_ids(sg_uen,mask)}GET /generate/sg_uen# → {"type":"sg_uen","result":"...","status":"ok"}GET /bulk/sg_uen?count=10POST /template {"types":["sg_uen"],"count":1}# mask=true: regulation-compliant outputGET /generate/sg_uen?mask=trueGET /bulk/sg_uen?count=5&mask=true| Parameter | Values | Description |
|---|---|---|
| --mask | true | false | Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…) |