es_nieIntlIDs

Mock Jutsu HOW-TO | UK

The es_nie function is a specialised tool within the mock-jutsu library, designed to provide developers with high-quality mock data for Spanish identification systems. A NIE, or Número de Identidad de Extranjero, is the mandatory tax and identification number for non-Spanish citizens residing or operating in Spain. By using this function, engineering teams can generate realistic test data that adheres strictly to official Spanish regulatory formats, ensuring that any application processing international IDs functions flawlessly throughout the development and quality assurance lifecycle.

Every string generated by the es_nie function follows the precise structural requirements mandated by the Spanish Ministry of the Interior. Each entry begins with an 'X', 'Y', or 'Z' prefix, followed by seven numerical digits and a final control letter. Crucially, the function employs the standard MOD-23 algorithm to calculate the check letter. This ensures that the generated mock data is syntactically valid and will successfully pass through any checksum validation logic implemented in your backend services or frontend forms. This level of technical precision is essential for testing database integrity constraints and input masking without triggering false-positive validation errors.

Integrating es_nie into your existing workflow is seamless across various development environments. Whether you are building a Python-based automation suite using the jutsu.generate('es_nie') method, executing quick data generation tasks via the CLI with mockjutsu generate es_nie, or performing complex load testing in JMeter using the ${__mockjutsu(es_nie,)} syntax, the library provides consistent and reliable results. This versatility makes mock-jutsu an indispensable asset for QA engineers and software architects who require dependable test data for diverse technical ecosystems and internationalisation projects.

Beyond simple string generation, utilising the es_nie function helps organisations remain compliant with data protection regulations such as GDPR. By replacing real personal information with synthetic mock data, developers can simulate complex KYC workflows, user registration processes, and financial transactions without compromising security or privacy. Ultimately, mock-jutsu streamlines the testing process, allowing developers to focus on building robust features and high-performance systems rather than manually crafting complex identification strings for their testing scenarios.

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

Parameters

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

Other Languages