Skip to content

Main content

Random Identifier Transcription Error Corpus Generator

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.

Loading tool…

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

  1. Supply kinds, operations, count in the field shapes below. Set seed when you need an explicit replay.
  2. 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.
  3. 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 fieldMeaning and unitsAccepted input
kindsKindsRequired. Array of Text; one of "ean-13", "isbn-13".; minimum items 1; maximum items 2.
operationsOperationsRequired. Array of Text; one of "substitution", "deletion", "transposition".; minimum items 1; maximum items 3.
countRequested count; the mechanics explain whether one draw expands into several returned records.Required. Safe integer; minimum 1; maximum 64.
seedOptional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed.Optional. Safe integer.
Output fieldInterpretationReturned shape
casesCasesRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 64.
cases[].kindKindRequired. Text; one of "ean-13", "isbn-13".
cases[].originalOriginalRequired. Text; minimum UTF-16 length 13; maximum UTF-16 length 13.
cases[].originalValidationOriginal ValidationRequired. Object; no unknown keys.
cases[].originalValidation.normalizedNormalizedRequired. Text.
cases[].originalValidation.typeTypeRequired. Text.
cases[].originalValidation.validValidity under the specific model or delegated checker described above.Required. Boolean.
cases[].operationOperationRequired. Text; one of "substitution", "deletion", "transposition".
cases[].positionPositionRequired. Safe integer; minimum 0; maximum 12.
cases[].beforeBeforeRequired. Text; minimum UTF-16 length 1; maximum UTF-16 length 2.
cases[].afterAfterRequired. Text; maximum UTF-16 length 2.
cases[].mutatedMutatedRequired. Text; minimum UTF-16 length 12; maximum UTF-16 length 13.
cases[].changedChangedRequired. Boolean.
cases[].mutatedValidationMutated ValidationRequired. Object; no unknown keys.
cases[].mutatedValidation.normalizedNormalizedRequired. Text.
cases[].mutatedValidation.typeTypeRequired. Text.
cases[].mutatedValidation.validValidity under the specific model or delegated checker described above.Required. Boolean.
randomnessReplay 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.seedOptional numeric replay seed; normalization and precedence are explained below.Required. Safe integer. or Null.
randomness.sourceSourceRequired. 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.

json
{
  "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

  1. Tool behavior and example: Random Identifier Transcription Error Corpus Generator — tool.io

  2. Calculation or validation: generate/ean-13 — tool.io

  3. Calculation or validation: generate/isbn-13 — tool.io

Similar or alternative tools