The University of Nottingham has created an open source program called OpenPseudonymiser which is used by (but not limited too) the NHS. It allows users to pseudonymise datasets by creating a digest of one or more columns of a CSV file.
The program incorporates the NHSNumberValiadtor to validate NHS numbers used within the program.
Go to the OpenPseudonymiser website for more details about the project.
The NHSNumberValidator has been built in both C# and PHP. I plan to expand the examples to other languages in the furture. The OpenPseudonymiser uses the C# variant of the code.
I am very delighted that this is being used by the University and wish the project great success.
More information on the NHSNumberValiadtor can be found in the code pages.
The source code is available on Git hub https://github.com/pfwd/NHSNumber-Validation. Please read the wiki before use.