Package Exports
- uk-modulus-check
- uk-modulus-check/dist/UKModulusCheck.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (uk-modulus-check) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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).
Installation
npm install uk-modulus-checkUsage
const ModulusChecker = require('uk-modulus-check');
const modulusChecker = new ModulusChecker();
console.log(modulusChecker.check('180002', '00000190')); // true
console.log(modulusChecker.check('938063', '15763217')); // false', accountNumber: '', expectedResult: true
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)