anghelvalentin / CountryValidator

C# Validations for Social Security Numbers, VAT Codes and tax identification numbers
https://randommer.io/SocialNumber/VatValidator
36 stars 20 forks source link

Valid Ssn number returned as invalid (for Belgium) #10

Open Kamiseikyo opened 2 years ago

Kamiseikyo commented 2 years ago

Hi,

For several cases, SSN number in Belgium failed to validate correctly. Indeed, in BelgiumValidation class, line 50 : bool isValid = ModFunction(nrToCheck).ToString() == checkDigit; At that time, if checkDigit has a number below 10, it fails. It seems that int type doesn't keep the 0 in the beginning of a number.

For exemple : checkDigit returns '09' and ModFunction returns '9'.

You can try with this SSN : 96091736909

Thanks for your time !

morlando-sixmon commented 1 year ago

Hi, I have a same problem. @anghelvalentin Can you please update your code?

Thank in advance.