The imei2 function within the mock-jutsu library is a specialised tool designed for developers and QA engineers who require realistic telecom identifiers for their software environments. Unlike standard numerical strings, this function generates a 15-digit International Mobile Equipment Identity (IMEI) formatted with hyphens to improve readability and match specific database requirements. By producing values such as 49-015420-323751-8, it ensures that your mock data reflects the structural nuances often found in legacy systems or user-facing documentation where visual clarity is paramount. This attention to detail makes it an essential component for any comprehensive testing suite focused on mobile technology.
Reliability is a core component of mock-jutsu, and the imei2 function adheres strictly to industry standards. Every generated value follows the Luhn algorithm, also known as the modulus 10 formula, to calculate a valid check digit. This ensures that the test data passes both front-end validation logic and backend integrity checks without manual intervention. The string structure correctly simulates the Type Allocation Code (TAC) and the Serial Number (SNR), providing a high degree of authenticity. This technical precision means that developers can use these identifiers in complex workflows without triggering the validation errors that typically occur with randomly generated digit strings.
In practical testing scenarios, imei2 proves invaluable for mobile application development and telecommunications infrastructure simulation. Whether you are stress-testing a global billing system or verifying device registration modules, having access to hyphenated mock data allows for more granular edge-case testing. It is particularly useful for validating UI components where input masks are applied or for testing API endpoints that expect specific string patterns. By integrating this function into your automated suites via Python, the CLI, or JMeter, you can simulate a diverse fleet of virtual devices with ease, ensuring your application handles device identifiers robustly across all layers of the stack.
The primary benefit of using the imei2 function is the significant reduction in manual data preparation time. Instead of sourcing real hardware IDs—which poses privacy and security risks—mock-jutsu provides a safe, programmatic way to populate environments with high-quality test data. The versatility of the library allows for seamless integration across different platforms, ensuring that your data remains consistent whether you are working in a local development environment or a distributed performance testing cluster. This streamlined approach allows engineering teams to focus on core feature development rather than the complexities of data synthesis.
mockjutsu generate imei2mockjutsu bulk imei2 --count 10mockjutsu export imei2 --count 10 --format jsonmockjutsu export imei2 --count 10 --format csvmockjutsu export imei2 --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate imei2 --maskmockjutsu bulk imei2 --count 5 --maskfrom mockjutsu import jutsujutsu.generate('imei2')jutsu.bulk('imei2', count=10)jutsu.template(['imei2'], count=5)# mask=True: regulation-compliant outputjutsu.generate('imei2', mask=True)jutsu.bulk('imei2', count=5, mask=True)${__mockjutsu_telecom(imei2)}# JMeter Function: __mockjutsu_telecom# Parameter 1: imei2# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_telecom(imei2,mask)}GET /generate/imei2# → {"type":"imei2","result":"...","status":"ok"}GET /bulk/imei2?count=10POST /template {"types":["imei2"],"count":1}# mask=true: regulation-compliant outputGET /generate/imei2?mask=trueGET /bulk/imei2?count=5&mask=true| Parameter | Values | Description |
|---|---|---|
| --mask | true | false | Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…) |