Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Latest commit

 

History

History
42 lines (34 loc) · 1.72 KB

README.md

File metadata and controls

42 lines (34 loc) · 1.72 KB

Modulus Checker

This is a C# implementation of UK Bank Account Modulus Checking. Modulus Checking is a process used to determine if a given account number could be valid for a given sort code.


Receiving a valid modulus check result only means that the Sort Code and Account Number pair could exist not that they do!


The algorithms, test cases and reference data can be found on the vocalink website. That site should be considered the authoritative source for the modulus checking algorithm and weighting data.

Nuget

Modulus Checker is available on Nuget. To install it run the following command in the Package Manager Console Install-Package ModulusChecker and reference its namespace as using ModulusChecking;

Usage

var sortCode = "012345";
var accountNumber = "12345678";
var modulusChecker	= new ModulusChecker();
var result =  modulusChecker
			.CheckBankAccount(sortCode,accountNumber);

If looping over a number of bank account details it is not necessary to initialise the ModulusChecker between checks.

var things = new List<BankAccountDetails> { 
  //some items
}; 
var modulusChecker	= new ModulusChecker();
foreach(var thing in things) 
{
	var result =  modulusChecker
			.CheckBankAccount(thing.sortCode,
							thing.accountNumber);
}

License

This software is released under the MIT license.

NB the resource text files valacdos.txt and scsubtab.txt are produced and released by Vocalink not me

Vocalink Version

Currently uses v3.3 of Vocalink Modulus Checking copied from their site on 2015-08-07