Wikipedia was updated to remove all the implementation links, so for completeness sake they are here now:
- Detailed description of the Verhoeff algorithm
- A description using lookup tables
- Verhoeff implementation in Perl
- Verhoeff implementation in FileMaker Pro
- Verhoeff implementation in MS SQL Server Transact SQL
- Biographical sketch of Jacobus Verhoeff
- Verhoeff validation and generation code in C++
- Verhoeff validation & generation code in Javascript
- Algorithm Verhoeff validation & generation code in C#, VB.NET, VBA, Java, Python, D, PHP, ActionScript and Pascal/Delphi
I have created a SQLServer User-Defined function for checking and creating the Verhoeff check digit.
See WikiPedia:Verhoeff_algorithm
The Verhoeff algorithm, a checksum formula for error detection first published in 1969, was developed by Dutch mathematician Jacobus Verhoeff (born 1927). Like the more widely known Luhn algorithm, it works with strings of decimal digits of any length. It does a better job than the Luhn algorithm, though, in that it will detect all "transposition" errors (switching of two adjacent digits), as well as catching many other types of errors that pass the Luhn formula undetected.
/* Usage for checking the validity of a number:*/
SELECT dbo.checksumVerhoeff([number TO be checked],0) <FROM [your TABLE]>
/*Usage for creating a check digit for a number:*/
SELECT dbo.checksumVerhoeff([your number],1) <FROM [your TABLE]>