Skip to content

Commit 8831db3

Browse files
authored
fix(isTaxID): fix el-GR locale when checksum is 10 (#1529)
Add correct tax identifier to demonstrate issue and fix. Thanks to: Panos Papadopoulos
1 parent edcd161 commit 8831db3

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/lib/isTaxID.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ function elGrCheck(tin) {
280280
for (let i = 0; i < 8; i++) {
281281
checksum += digits[i] * (2 ** (8 - i));
282282
}
283-
return checksum % 11 === digits[8];
283+
return ((checksum % 11) % 10) === digits[8];
284284
}
285285

286286
/*

test/validators.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9615,6 +9615,7 @@ describe('Validators', () => {
96159615
args: ['el-GR'],
96169616
valid: [
96179617
'758426713',
9618+
'032792320',
96189619
'054100004'],
96199620
invalid: [
96209621
'054100005',

0 commit comments

Comments
 (0)