Menu

DigitProof: one API for every check digit, and it fixes the wrong ones
📰

DigitProof: one API for every check digit, and it fixes the wrong ones

DEV Community: fastapi·DSP·about 13 hours ago
#XEqX1TpF
#devtofastapi#devto#dev#digit#identifier
Reading 0:00
15s threshold

Every codebase I have ever worked in has a graveyard of half-remembered validation rules. The IBAN check is mod-97, but only after you rearrange the string. The ISBN-10 check digit can be the letter X. A VIN has a check digit at position 9, unless it was built for a market that does not use one. Each identifier has its own standard, its own math, and its own way of quietly going wrong.

DigitProof is my attempt to put all of that in one place. It is a single API that validates nine families of structured identifiers, parses them, and, this is the part I actually wanted, tells you the correct check digit when the one you have is wrong.

What it validates

IBAN: length and structure for 86 countries, mod-97 check digits, BBAN parsing (bank code, branch code, account number) for 22 countries, SEPA flag, grouped formatting

LEI: the ISO 17442 format and its mod-97 check digits, with the LOU prefix broken out

ISIN: country and NSIN structure with the Luhn check digit

ISBN-10 and ISBN-13, including conversion…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.