The Verhoeff Integrity Engine is an OutSystems Forge component designed to generate and validate Verhoeff check digits for numeric identifiers. The Verhoeff algorithm is a checksum formula that detects common data entry errors, such as:
Single-digit errors
Adjacent digit transposition
Twin errors
This component provides both Client Actions and Server Actions, enabling validation on the UI layer (Reactive Web / Mobile) as well as on the server layer for secure processing.
The component is useful when building applications that require reliable numeric identifiers, such as:
Identity numbers
Customer IDs
Order numbers
Ticket numbers
Government IDs (e.g., Aadhaar)
The component is divided into two logical modules:
Library: VerhoeffIntegrityEngine_lib
Provides instant validation and generation within the browser.
Available Client Actions:
Library: VerhoeffIntegrityEngine_Is
Provides backend verification and generation to ensure integrity before database operations.
Available Server Actions:
The Verhoeff algorithm works using three predefined mathematical tables:
Defines digit multiplication operations.
Applies positional permutations to digits.
Used to compute the check digit.
The algorithm processes numbers right-to-left and computes a checksum value.
If the checksum equals 0, the number is valid.
Client actions allow real-time validation and generation inside UI logic without server calls.
Location:
Client Actions + VerhoeffIntegrityEngine_lib + GenerateVerhoeffNumber + Validate
Generates a Verhoeff check digit for a numeric value and returns the full number including the check digit.
This action is typically used when creating new identifiers in forms.
Input:
Length = 5
Output:
GeneratedVerhoeffNumber = 483921
Where:
48392 = base number 1 = Verhoeff check digit
Button Generate ID ? GenerateVerhoeffNumber ? Display GeneratedVerhoeffNumber
Validates whether a given number contains a correct Verhoeff check digit.
Used for client-side form validation.
InputAsText = 483921 Length = 6
Isvalid = True
Invalid Example:
483922 ? False
Server actions perform secure validation and generation on the backend, ensuring data integrity before saving records.
Server Actions + VerhoeffIntegrityEngine_Is + Generate + Verify
Generates a Verhoeff number on the server side.
This action is recommended when generating identifiers before inserting records into a database.
Length = 7
GeneratedVerhoeffNumber = 8392746
Create Record ? Generate ? Assign Identifier ? Insert Record
Verifies whether a number is valid according to the Verhoeff algorithm.
Used in backend validation workflows.
Numbertext = 8392746
IsValid = True
User enters ID ? Validate (Client Action) ? If valid ? Submit form Else ? Show validation error
Submit Form ? Verify (Server Action) ? If valid ? Save Record Else ? Reject Request
The component handles the following conditions:
Recommended validation before execution:
IsNumeric(Input) AND Length(Input) > 1
Client actions execute instantly in the browser
Server actions ensure secure backend validation
Recommended approach:
Client Validation + Server Validation
Although the Verhoeff algorithm helps detect data entry errors, it does not provide cryptographic security.
Therefore it should not be used for security-sensitive validation such as:
Password protection
Encryption
Secure tokens
The Verhoeff Integrity Engine can be used in systems requiring reliable numeric identifiers, including:
Transaction IDs
Government identifiers
Invoice numbers
Recommended usage pattern:
Client validation ? Immediate feedback Server validation ? Final verification
Always ensure:
Input contains only numeric characters
Correct identifier length is enforced
Server validation is executed before saving data