diff --git a/VatValidation/Countries/NO.cs b/VatValidation/Countries/NO.cs index cbb1394..fd6e540 100644 --- a/VatValidation/Countries/NO.cs +++ b/VatValidation/Countries/NO.cs @@ -14,6 +14,10 @@ namespace VatValidation.Countries; /// valid, in: 977 074 010MVA, national: 977 074 010, vat: NO 977 074 010, stripped: 977074010, vatstripped: NO 977 074 010 /// valid, in: NO 977 074 010MVA, national: 977 074 010, vat: NO 977 074 010, stripped: 977074010, vatstripped: NO 977 074 010 /// valid, in: NO977074010, national: 977 074 010, vat: NO 977 074 010, stripped: 977074010, vatstripped: NO 977 074 010 +/// valid, in: 310033243, national: 310 033 243, vat: NO 310 033 243, stripped: 310033243, comment: test number from skatteetaten.no +/// invalid, in: 310033242, national: 310033242, vat: NO 310033242, stripped: 310033242 +/// valid, in: 212409472, national: 212 409 472, vat: NO 212 409 472, stripped: 212409472, comment: test number from skatteetaten.no +/// invalid, in: 212409471, national: 212409471, vat: NO 212409471, stripped: 212409471 /// public class NO : CountryBase { @@ -31,7 +35,9 @@ private NO() { } private static readonly int[] _multipliers = [3, 2, 7, 6, 5, 4, 3, 2, 1]; // https://vatstack.com/articles/norway-vat-number-validation - private static bool ValidFormat(ReadOnlySpan d) => d.Length == 9 && (d[0] == 8 || d[0] == 9); + private static bool ValidFormat(ReadOnlySpan d) => d.Length == 9 && ( + d[0] == 2 || d[0] == 3 || + d[0] == 8 || d[0] == 9); internal static bool Valid(ReadOnlySpan digits) => ValidFormat(digits) && Valid(digits.ToArray()); private static bool Valid(int[] digits) => (11 - digits