Skip to content

residently/uk_account_validator

 
 

Repository files navigation

UkAccountValidator

Fork of ball-hayden/uk_account_validator maintained by Residently to keep the modulus checking data up to date.

This gem validates UK account numbers against their sort codes in accordance with VocaLink's modulus checking specification, which can be downloaded from here.

Note that this gem ensures the sort code and account number are valid, not that they exist.

The resource text files valacdos.txt and scsubtab.txt are produced and released by VocaLink.

Requires Ruby > 2.0.0

Data sources

VocaLink publishes updates roughly quarterly. Last updated: 2026-07-06.

Usage

UkAccountValidator::Validator.new(sort_code, account_number).valid?

or

validator = UkAccountValidator::Validator.new
validator.account_number = account_number
validator.sort_code      = sort_code
validator.valid?

Installation

Add this line to your application's Gemfile:

gem 'uk_account_validator', github: 'residently/uk_account_validator'

And then execute:

$ bundle

Updating the data

  1. Download the latest valacdos.txt from the VocaLink link above
  2. Replace data/valacdos.txt
  3. Commit and push

About

Validate UK Account Numbers and Sort Codes

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Ruby 71.9%
  • Gherkin 28.1%