UKModulusCheck


Validator

Namespace: UkModulusCheck.CSharp

The C# API of the library

Constructors

ConstructorDescription
new()
Signature: unit -> Validator

CompiledName: .ctor

Instance members

Instance memberDescription
LoadData(rulesPath substitutionsPath)
Signature: rulesPath:string -> substitutionsPath:string -> unit

Loads rules for specific sort code ranges and sort code substitution table from files

Parameters

  • rulesPath - path to the file containing rules from VocaLink (valacdos.txt)
  • substitutionsPath - path to the file containing substitutions from VocaLink (scsubtab.txt)

Output type

  • void

Exceptions

  • Exceptions may be thrown when file is not accesible (e.g. not found, lack of permissions)
ValidateAccount(sortCode accountNo)
Signature: sortCode:SortCode -> accountNo:AccountNumber -> ValidationResult

Runs modulus check on UK sort code and account number given the rules and substitution tables. Requires LoadData to be called first to initialize data tables.

Parameters

  • sortCode - sort code to check
  • accountNo - account number to check

Output type

  • ValidationResult - describes the validation result and the reason in case of failure

Exceptions

  • Exception will be thrown when method is called before initializing the instance (calling LoadData).
Fork me on GitHub