Description
Inspect an explicit check-digit position convention without computing or validating a checksum.
Identifier validation can involve several distinct questions: whether text has the expected shape, whether a checksum is consistent, and whether an authority actually assigned the identifier. Formatting and field extraction address narrower questions. Each result must be read according to the particular property the tool checks.
Inspect an explicit check-digit position convention without computing or validating a checksum.
When to use this tool
Use Check Digit Position Contract when you need the particular shape, formatting, field, or checksum property as one explicit stage in an identifier workflow.
How to use the tool and how it works
- Enter length, checkPosition, positionIsOneBased. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read zeroBasedPosition, validPosition. Inspect validPosition before interpreting the associated values.
Require nonnegative integer length and integer checkPosition. Subtract one when positionIsOneBased, then return zeroBasedPosition and validPosition for membership in the half-open range zero through length.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| length | Length | Required. Safe integer; minimum 0. |
| checkPosition | Integer position under the selected zero- or one-based convention. | Required. Safe integer. |
| positionIsOneBased | Position Is One Based | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| zeroBasedPosition | Zero Based Position | Required. Safe integer. |
| validPosition | Valid Position | Required. Boolean. |
{
"input": {
"length": 13,
"checkPosition": 13,
"positionIsOneBased": true
},
"output": {
"zeroBasedPosition": 12,
"validPosition": true
}
} Limitations and assumptions
- A negative or out-of-range converted position is returned with validPosition false rather than rejected. This checks indexing conventions, not a check character's value or checksum algorithm.
- The field tables state structural bounds; the mechanics also specify cross-field constraints. Malformed inputs and unsupported domains cause errors. A successful false flag, empty branch value, or zero placeholder has the meaning stated above and is distinct from an input error.
Alternative or Complementary methods
Use a complete format and checksum validator when required, then consult the issuing registry or verification process for assignment and identity. Preserve meaningful leading zeros as text.
References
Similar or alternative tools
- CAS Check Digit Remainder Term
Calculate a CAS-style body digit weighted sum and its modulo-10 remainder.
- Validation: Cas Three Part Digit Shape
Check only the three-part CAS Registry Number digit/hyphen shape, explicitly not its check digit or substance registry.