-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add standard and 'double alternate' methods #2
Conversation
} | ||
|
||
return this.pickPosition(number, 'h') === (10 - remainder); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for else
keyword.
*/ | ||
|
||
loadScsubtab() { | ||
const reader = new LineReader(`${__dirname}/data/scsubtab.txt`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change LineReader
to a simple require?
227db9c
to
f96b662
Compare
|
||
const accounts = { | ||
invalid: [ | ||
{ number: '15763217', sortCode: '938063' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change number
to accountNumber
?
f96b662
to
9b8c02b
Compare
describe('UkModulusChecking', () => { | ||
describe('isValid()', () => { | ||
accounts.invalid.forEach(function(account) { | ||
it(`should return false if sortCode is ${account.sortCode} and number is ${account.number}`, () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
… and account number is …
ff6ac3a
to
04a9e5c
Compare
@@ -1,4 +1,4 @@ | |||
FROM mhart/alpine-node:0.10 | |||
FROM seegno/node:latest | |||
|
|||
RUN adduser -S node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The seegno/node
Dockerfile already adds this user.
02556a8
to
09d3be4
Compare
09d3be4
to
703bb08
Compare
This commit adds both 'modulus weight' and 'sorting code substitution' tables along side with the validation account numbers documentation.
703bb08
to
d847a5e
Compare
Add standard and 'double alternate' methods
Currently we are using a fork of modcheck which is a very poor implementation of the
modulus checking
algorithm as described here.This PR adds a implementation of
modulus-checking
, inspired on bazerk/uk-modulus-checking, which will help us to avoid some issues regarding correct account configuration being flagged as invalid.NOTE: All the test cases described in the documentation are covered by unit tests.