JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10282
  • Score
    100M100P100Q152576F
  • License ISC

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).

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)