tcknIdentity

Mock Jutsu HOW-TO | UK

The mock-jutsu library provides a robust solution for developers and QA engineers who require valid Turkish Identification Numbers for their software environments. The tckn function generates an 11-digit string that adheres strictly to the official Turkish Republic identity standards. By using this tool, teams can produce high-quality mock data that bypasses basic front-end and back-end validation checks, ensuring that test data remains realistic and functional throughout the entire development lifecycle.

Accuracy is paramount when dealing with identity identifiers, and the tckn utility within mock-jutsu excels by implementing the complex Modulo 10/11 validation algorithm. A valid TCKN is not merely a sequence of random digits; the digits must satisfy specific mathematical relationships to produce the correct checksum. Specifically, the algorithm ensures that the first digit is non-zero, while the 10th and 11th digits are calculated based on the sum of odd and even-positioned digits. This level of precision makes it an indispensable asset for testing database integrity and form validation logic where simple random numbers would fail.

Incorporating this function into your workflow is seamless across various platforms. Whether you are scripting in Python using jutsu.generate('tckn'), executing quick commands via the CLI with mockjutsu generate tckn, or performing load testing in JMeter with the ${__mockjutsu(tckn,)} syntax, the library offers consistent results. This versatility allows developers to automate the creation of test data for complex scenarios such as Know Your Customer (KYC) processes, banking registration workflows, and e-government portal simulations without the risk of using real, sensitive personal information.

Ultimately, using mock-jutsu to generate a tckn enhances productivity by removing the manual burden of finding or creating valid test identifiers. It provides a secure way to handle regional identity requirements while maintaining compliance with data protection regulations. By integrating these automated generation capabilities, engineering teams can focus on refining application logic rather than troubleshooting invalid data errors, leading to more resilient and reliable software releases.

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

Parameters

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

Other Languages