UKModulusCheck
Overview
TypeScript class that validates UK bank account details using the modulus checking algorithm.
It only users vanilla typescript, and the 'fs' file-loading library.
From time to time, Vocalink updates the txt files here mapping sort-code ranges to validation weights. We currently use v7-90
(valid from 17 August 2024).
Usage
import ModulusChecker from 'UKModulusCheck';
let checker = new ModulusCheck()
checker.validate({ sortCode: '180002', accountNumber: '00000190'})
# true
checker.validate({ sortCode: '938063', accountNumber: '15763217'})
# false
', accountNumber: '', expectedResult: true
Installation
[todo add to npm and add]
Details
This specification details logic to differentiate valid vs. invalid pairs of sort-code and account number.
A mathematical algorithm compares the two values, and check if the two can be paired together legitimately.
This page details any changes to the specification.
License
MIT
Credits
Many thanks to bazerk/uk-modulus-checking for inspiration (Python)
Also thanks to uphold/uk-modulus-checking for creating a good Javascript implementation. It doesn't seem to be updated since valacdos-v640, which motivats the create (12/10/2020)