The checkdigit framework masks values containing digits with a calculated checkdigit. The framework is purpose built to support a number of built in instances with similar but unique compositions:
It has also been extended to support Australian TFN number masking configuration. The Checkdigit framework contains several flexible options that may support other use cases requiring a modulus calculation and checkdigit. Further custom instances can be built using the algorithm API.
While the framework may support other use cases, it’s primary purpose is to support masking the above build in Japanese identifier number algorithms, and the creation of Australian TFN instances.
Configuration parameters
| Parameters | Description |
|---|---|
| weightList | List of weights used when calculating the check digit. |
| modulusNumber | The modulus value used in the check digit calculation. |
| preserveRegex | Regular expression defining characters that should be preserved and excluded from the check digit calculation. |
| checkDigitIndex | Position where the calculated check digit is inserted in the output string. |
| numericAlgorithm | Algorithm used to mask the digits before calculating the check digit. |
| fallbackAlgorithm | Algorithm used if the input value does not match the expected format. |
| checksumCalculationType | Specifies the checksum calculation method. Supported values include STANDARD and TFN. |
| swapModulusForZeroRemainder | Indicates whether the modulus value should be substituted when the remainder is zero. |
| calculateChecksumRightToLeft | Determines whether the checksum calculation iterates through digits from right to left. |
| numDigitsForCheckdigitCalculation | Number of digits used when calculating the check digit. |
Create an algorithm using this framework
To create an algorithm using this framework, follow the steps in Create an algorithm and select Checkdigit during the Configuration step.