Description
Generate synthetic checksum-valid EAN-13 and 978-prefixed ISBN-13 originals, apply a selected decimal substitution, deletion, or adjacent transposition, and record actual GTIN/ISBN validator outcomes; swaps may be unchanged or remain valid, and checksum validity is not product or publication allocation.
A parser corpus pairs literal input spellings or structured documents with observable parser results or explicitly constructed expectations. Successful parsing, semantic validity, and exact round-trip preservation are separate properties, so test records retain the relevant evidence.
Generate synthetic checksum-valid EAN-13 and 978-prefixed ISBN-13 originals, apply a selected decimal substitution, deletion, or adjacent transposition, and record actual GTIN/ISBN validator outcomes; swaps may be unchanged or remain valid, and checksum validity is not product or publication allocation.
When to use this tool
Use this generator to create reproducible identifier transcription error corpus cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.
How to use the tool and how it works
- Supply kinds, operations, count in the field shapes below. Set seed when you need an explicit replay.
- Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
- Read cases. Use the conventions below and keep answer-bearing fields separate when presenting an exercise.
Generate checksum-valid EAN-13 or 978-prefixed ISBN-13 identifiers, then apply a digit substitution, deletion, or adjacent transposition. Retain original and mutated validation results, edit details, and a changed flag.1
Delegated operations used for this result: ean 13; isbn 13. Their calculation or parsing conventions apply to the corresponding result fields.2, 3
| Input field | Meaning and units | Accepted input |
|---|---|---|
| kinds | Kinds | Required. Array of Text; one of "ean-13", "isbn-13".; minimum items 1; maximum items 2. |
| operations | Operations | Required. Array of Text; one of "substitution", "deletion", "transposition".; minimum items 1; maximum items 3. |
| count | Requested count; the mechanics explain whether one draw expands into several returned records. | Required. Safe integer; minimum 1; maximum 64. |
| seed | Optional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed. | Optional. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| cases | Cases | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 64. |
| cases[].kind | Kind | Required. Text; one of "ean-13", "isbn-13". |
| cases[].original | Original | Required. Text; minimum UTF-16 length 13; maximum UTF-16 length 13. |
| cases[].originalValidation | Original Validation | Required. Object; no unknown keys. |
| cases[].originalValidation.normalized | Normalized | Required. Text. |
| cases[].originalValidation.type | Type | Required. Text. |
| cases[].originalValidation.valid | Validity under the specific model or delegated checker described above. | Required. Boolean. |
| cases[].operation | Operation | Required. Text; one of "substitution", "deletion", "transposition". |
| cases[].position | Position | Required. Safe integer; minimum 0; maximum 12. |
| cases[].before | Before | Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 2. |
| cases[].after | After | Required. Text; maximum UTF-16 length 2. |
| cases[].mutated | Mutated | Required. Text; minimum UTF-16 length 12; maximum UTF-16 length 13. |
| cases[].changed | Changed | Required. Boolean. |
| cases[].mutatedValidation | Mutated Validation | Required. Object; no unknown keys. |
| cases[].mutatedValidation.normalized | Normalized | Required. Text. |
| cases[].mutatedValidation.type | Type | Required. Text. |
| cases[].mutatedValidation.valid | Validity under the specific model or delegated checker described above. | Required. Boolean. |
| randomness | Replay metadata: source is seed or context; seed is the normalized 32-bit seed or null for a context source. | Required. Object; no unknown keys. |
| randomness.seed | Optional numeric replay seed; normalization and precedence are explained below. | Required. Safe integer. or Null. |
| randomness.source | Source | Required. Text; one of "context", "seed". |
An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.
{
"input": {
"kinds": [
"ean-13",
"isbn-13"
],
"operations": [
"substitution",
"deletion",
"transposition"
],
"count": 5,
"seed": 42
},
"output": {
"cases": [
{
"kind": "isbn-13",
"original": "9784861526848",
"originalValidation": {
"normalized": "9784861526848",
"type": "ISBN-13",
"valid": true
},
"operation": "substitution",
"position": 11,
"before": "4",
"after": "1",
"mutated": "9784861526818",
"changed": true,
"mutatedValidation": {
"normalized": "9784861526818",
"type": "ISBN-13",
"valid": false
}
},
{
"kind": "ean-13",
"original": "1566048050203",
"originalValidation": {
"normalized": "1566048050203",
"type": "GTIN-13",
"valid": true
},
"operation": "substitution",
"position": 10,
"before": "2",
"after": "7",
"mutated": "1566048050703",
"changed": true,
"mutatedValidation": {
"normalized": "1566048050703",
"type": "GTIN-13",
"valid": false
}
},
{
"kind": "ean-13",
"original": "1848340055262",
"originalValidation": {
"normalized": "1848340055262",
"type": "GTIN-13",
"valid": true
},
"operation": "substitution",
"position": 3,
"before": "8",
"after": "5",
"mutated": "1845340055262",
"changed": true,
"mutatedValidation": {
"normalized": "1845340055262",
"type": "GTIN-13",
"valid": false
}
},
{
"kind": "isbn-13",
"original": "9785222066690",
"originalValidation": {
"normalized": "9785222066690",
"type": "ISBN-13",
"valid": true
},
"operation": "substitution",
"position": 12,
"before": "0",
"after": "4",
"mutated": "9785222066694",
"changed": true,
"mutatedValidation": {
"normalized": "9785222066694",
"type": "ISBN-13",
"valid": false
}
},
{
"kind": "isbn-13",
"original": "9781103468072",
"originalValidation": {
"normalized": "9781103468072",
"type": "ISBN-13",
"valid": true
},
"operation": "transposition",
"position": 3,
"before": "11",
"after": "11",
"mutated": "9781103468072",
"changed": false,
"mutatedValidation": {
"normalized": "9781103468072",
"type": "ISBN-13",
"valid": true
}
}
],
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- Swapping equal adjacent digits can leave the identifier unchanged and some transpositions can pass a checksum. Checksum validity does not establish issued registration, authenticity, ownership, or product identity.
- A replay requires the same complete input and implementation. Randomized construction does not guarantee uniform coverage of every feasible output; finite samples can repeat unless a distinct-selection rule is explicitly stated.
- The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.
Alternative or Complementary methods
For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.
References
Similar or alternative tools
- Random Structured Validation Error Corpus Generator
Mutate supplied valid number, UUID, and IP strings and retain each allowlisted core's success shape, validity flag, and structured issues.
- Random JSON Duplicate ID Dataset Generator
Construct linked records with an exact duplicate insertion count and retain missing, unique and ambiguous reference candidate indices.