Skip to main content
Check Digit Calculator
Diagnostic

Check Digit Test Vector Generator

Review valid inputs, broken identifiers and edge cases for checksum tests. Build test vectors that check an implementation's outputs.

Last updated:

Diagnostic, Analysis & Utilities

Create examples for implementation checks.

Length: 10 chars
Calculated Check Character / Checksum
--Ready
Complete Validated Sequence:
--
Arithmetic Steps & Mathematical Specification

Initialising algorithm engine for Check Digit Test Vector Generator...

How Check Digit Test Vector Generator Works?

The Check Digit Test Vector Generator creates test inputs with known answers. Each set includes valid codes, deliberately broken codes and edge cases for the chosen algorithm. Use them to check an implementation.

  1. 1Select the algorithm and the number of vectors.
  2. 2Generate valid vectors from random or published payloads.
  3. 3Create invalid vectors by changing 1 digit or swapping 2 neighbours.
  4. 4Add edge cases: all zeros, maximum length, X or K results.
  5. 5Export the set as JSON, CSV, or code.

Check Digit Test Vector Generator Formula

The vector rule is Valid = payload + f(payload) and Invalid = mutate(Valid), where mutate makes a change the algorithm detects.

valid = p ‖ f(p)
invalid = p ‖ c',  c' ≠ f(p)
edge = { 0…0, max length, special outputs }
  • c' is a wrong check character.
Worked example: Luhn vectors
Valid: 79927398713
Invalid (wrong check): 79927398714
Invalid (swap): 79927398731
Edge: 0000000000 → 0

Check Digit Test Vector Generator Conversion Table

The test vector table lists published reference vectors for 8 algorithms with a matching invalid vector.

AlgorithmPayloadExpected checkValid vectorInvalid vector
Luhn799273987137992739871379927398714
GS1 Mod 10590123412345759012341234575901234123458
ISBN-10080442957X080442957X0804429570
Verhoeff236323632364
Damm572457245725
ISO 7064 MOD 11-2079X079X0790
ISO 7064 MOD 97-10794447944479445
ISO 7064 MOD 1271-36ISO793WISO793WISO790

What is Check Digit Test Vector Generator?

A Check Digit Test Vector Generator is a tool that creates known-answer test data for check digit implementations. Test vectors catch off-by-one errors, wrong weight directions, and mapping bugs.

Published reference vectors, such as the ISO 7064 annex examples and the Luhn sample 79927398713, anchor the tests to an external source.

What are the uses of Check Digit Test Vector Generator?

There are 3 main uses of the Check Digit Test Vector Generator, including unit tests, vendor acceptance, and regression suites.

  • Unit tests: Developers paste vectors into test files.
  • Vendor acceptance: Buyers test vendor software against known answers.
  • Regression suites: Teams keep vectors to catch future breakage.