crnIdentity

Mock Jutsu HOW-TO | UK

In the landscape of UK corporate compliance and software development, accurately simulating business entities is a critical requirement for building reliable applications. The crn function within the mock-jutsu library provides a robust solution for generating realistic UK Company Registration Numbers. Whether you are developing a fintech application, a corporate CRM system, or a procurement platform, having access to high-quality mock data ensures that your validation logic and database schemas are tested against industry-standard formats without the risk of using real-world sensitive information.

A standard UK CRN consists of an eight-character identifier, typically comprising eight digits for companies registered in England and Wales, or specific two-letter prefixes such as SC for Scotland or NI for Northern Ireland followed by six digits. The mock-jutsu implementation strictly adheres to these Companies House conventions, ensuring that the generated test data passes front-end input masks and back-end regex validations. By automating the creation of these identifiers, developers can bypass the tedious task of manual data entry and focus on refining the core functionality and user experience of their applications.

Integrating this functionality into your development lifecycle is seamless, regardless of your preferred environment or tooling. For rapid prototyping or shell scripting, the command line interface allows you to run "mockjutsu generate crn" to output a value instantly. Python developers can leverage the library directly using the jutsu.generate('crn') method, making it an ideal choice for unit testing and automated database seeding scripts. Furthermore, for performance and load testing, the JMeter integration via the ${__mockjutsu(crn,)} syntax enables the simulation of high-volume business registrations with ease.

Utilising the crn function offers significant advantages in terms of security and operational efficiency. By using synthetic test data, organisations can maintain strict compliance with data protection regulations like GDPR, as no actual company records are processed or stored during the testing phase. This approach also allows QA teams to simulate various edge cases to ensure comprehensive coverage across different regional formats. Ultimately, mock-jutsu empowers engineering teams to build more resilient systems by providing reliable, predictable, and compliant data generation tools that fit perfectly into modern CI/CD pipelines.

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

Parameters

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

Other Languages