diff --git a/src/sv/nit.ts b/src/sv/nit.ts index 8e3fce36..631dfec2 100644 --- a/src/sv/nit.ts +++ b/src/sv/nit.ts @@ -84,7 +84,7 @@ const impl: Validator = { let sum; const [front, check] = strings.splitAt(value, 13); - if (value.substr(10, 3) === '100') { + if (value.slice(10, 13) <= '100') { sum = weightedSum(front, { weights: [14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2], @@ -92,11 +92,12 @@ const impl: Validator = { }) % 10; } else { sum = - (11 - + ((11 - weightedSum(front, { weights: [2, 7, 6, 5, 4, 3, 2, 7, 6, 5, 4, 3, 2], modulus: 11, })) % + 11) % 10; }