FabriceAv.CountryValidator
1.1.4
dotnet add package FabriceAv.CountryValidator --version 1.1.4
NuGet\Install-Package FabriceAv.CountryValidator -Version 1.1.4
<PackageReference Include="FabriceAv.CountryValidator" Version="1.1.4" />
paket add FabriceAv.CountryValidator --version 1.1.4
#r "nuget: FabriceAv.CountryValidator, 1.1.4"
// Install FabriceAv.CountryValidator as a Cake Addin #addin nuget:?package=FabriceAv.CountryValidator&version=1.1.4 // Install FabriceAv.CountryValidator as a Cake Tool #tool nuget:?package=FabriceAv.CountryValidator&version=1.1.4
Country Validator
Country Validator is a .NET library that can validate VAT codes, national identification numbers and tax identification numbers for individuals and companies
Features
- Validate Social Security Numbers/Personal Identity Numbers
- Validate VAT Codes
- Validate Tax Indentification Numbers for Individuals
- Validate Tax Identification Numbers For Companies
Install
Nuget Package CountryValidator Nuget Package CountryValidator.DataAnnotations
Install-Package CountryValidator
Install-Package CountryValidator.DataAnnotations
How to use Country Validator
Using Validator Class
CountryValidator validator = new CountryValidator();
ValidationResult validationResult = validator.ValidateNationalIdentityCode(ssn, Country.US);
if (validationResult.IsValid)
{
Console.WriteLine("Valid");
}
else
{
Console.WriteLine(validationResult.ErrorMessage);
}
Using Data Annotations
[HttpPost]
public IActionResult ValidateSSN([Required, SSNAttribute(Country.US)]string ssn)
{
if (!ModelState.IsValid)
{
//log exception
}
return Ok();
}
Live Demo
Social Security Number Validation
Supported Countries
Supported Country | Alpha Code 2 | National Identification Number Name | VAT Code | Entity code | Postal Code |
---|---|---|---|---|---|
Andorra | AD | NRT (Número de Registre Tributari, Andorra tax number) | NRT (Número de Registre Tributari, Andorra tax number) | NRT (Número de Registre Tributari, Andorra tax number) | ✔️ |
United Arab Emirates | AE | ❌ | ❌ | ❌ | |
Albania | AL | Identity Number - Numri i Identitetit (NID) | NIPT (Numri i Identifikimit për Personin e Tatueshëm, Albanian VAT number). | NIPT | ✔️ |
Armenia | AM | TIN Number | TIN Number | TIN Number | ✔️ |
Argentina | AR | DNI number | VAT/IVA/CUIT | CUIT | ✔️ |
Austria | AT | Versicherungsnummer (VNR, SVNR, VSNR) | UID (Umsatzsteuer-Identifikationsnummer) | ✔️ | |
Australia | AU | TFN | ABN | ABN/ACN/TFN | ✔️ |
Azerbaijan | AZ | PIN - Personal Identification Number | VÖEN/TIN Number | VÖEN/TIN Number | ✔️ |
Bosnia | BA | Unique Master Citizen Number JMBG | ❌ | ✔️ | |
Belgium | BE | Rijksregisternummer | BTW, TVA, NWSt, ondernemingsnummer (Belgian enterprise number). | ✔️ | |
Bulgaria | BG | Edinen grazhdanski nomer (EGN) | Идентификационен номер по ДДС | ✔️ | |
Bahrain | BH | Social security number | ❌ | ❌ | ✔️ |
Bolivia | BO | CI Number | Número de Identificación Tributaria | Número de Identificación Tributaria | ✔️ |
Brazil | BR | CPF | Brazil Cadastro Nacional da Pessoa Juridica (CNPJ) | Brazil Cadastro Nacional da Pessoa Juridica (CNPJ) | ✔️ |
Belarus | BY | Payer's account number (UNP) | Payer's account number (UNP) | Payer's account number (UNP) | ✔️ |
Canada | CA | SIN Number | Business Number | Business Number | ✔️ |
Chile | CL | National Tax Number (RUN/RUT) | National Tax Number (RUN/RUT) | National Tax Number (RUN/RUT) | ✔️ |
China | CN | Social Number (15 digits and 18 digits) | ❌ | Business Number | ✔️ |
Colombia | CO | NIT (Número De Identificación Tributaria, Colombian identity code) | VAT | RUT (Registro Unico Tributario) | ✔️ |
Costa Rica | CR | CPF (Cédula de Persona Física,physical person ID number)/CR(Cédula de Residencia) | CPJ | CPJ | ✔️ |
Cuba | CU | NI (Número de identidad) | ❌ | ❌ | ✔️ |
Croatia | HR | OIB (Osobni identifikacijski broj, Croatian identification number) | OIB (Osobni identifikacijski broj, Croatian identification number) | OIB (Osobni identifikacijski broj) | ✔️ |
Cyprus | CY | Identity Number | ΦΠΑ | ✔️ | |
Czechia | CZ | Rodné Císlo (RČ) | Danove Identifikacni Cislo (DIC/VAT) | ✔️ | |
Denmark | DK | Det Centrale Personregister (CPR) | Momsregistreringsnummer (CVR/VAT) | ✔️ | |
Dominican Republic | DO | Cedula | RNC (Registro Nacional del Contribuyente) | RNC (Registro Nacional del Contribuyente) | ✔️ |
Ecuador | EC | Registro Unico de Contribuyentes (RUC) | Registro Unico de Contribuyentes (RUC) | Registro Unico de Contribuyentes (RUC) | ✔️ |
Estonia | EE | Personal Id - Isikukood | Kaibemaksukohuslase (KMKR) | Registrikood (Estonian organisation registration code) | ✔️ |
Finland | FI | Henkilötunnus (HETU) | Arvonlisaveronumero (ALV) | Arvonlisaveronumero (ALV) | ✔️ |
Faroe Islands | FO | P-number | V-number | V-number | ✔️ |
France | FR | INSEE/NIR (French personal identification number) | Taxe sur la Valeur Ajoutee (TVA) | SIREN | ✔️ |
Germany | DE | Steueridentifikationsnummer | Umsatzsteur Identifikationnummer (VAT) | Steuernummer | ✔️ |
Greece | GR | AMKA (Αριθμός Μητρώου Κοινωνικής Ασφάλισης, Greek social security number) | VAT Number (FPA) | VAT Number (FPA) | ✔️ |
Great Britain | GB | NINO or NHS | VAT Reg No | Value added tax registration number | ✔️ |
Guatemala | GT | ❌ | NIT | NIT (Número de Identificación Tributaria) | ✔️ |
Hong Kong | HK | Social number | ❌ | ❌ | ❌ |
Hungary | HU | Szemelyi Szam Ellenorzese | Kozossegi Adoszam (ANUM) | Cegjegyzekszam Ellenorzese | ✔️ |
Indonesia | ID | NPWP | NPWP - Nomor Pokok Wajib Pajak | NPWP | ✔️ |
Ireland | IE | PPS No (Personal Public Service Number, Irish personal number). | Irish Tax Reference Number (VAT) | ✔️ | |
Israel | IL | ✔️ | |||
India | IN | PAN (Permanent Account Number) | VAT TIN / CST TIN | PAN (Permanent Account Number) | ✔️ |
Iceland | IS | Kennitala | Virdisaukaskattsnumer (VSK) | Kennitala | ✔️ |
Italy | IT | Codice fiscale - Fiscal Code | Partita IVA | ✔️ | |
Japan | JP | Japan My Number | Japan My Number | CN hōjin bangō, Japanese Corporate Number | ✔️ |
Korea | KR | Resident Registration Number (RRN) | ❌ | ❌ | ✔️ |
Kazakhstan | KZ | PIN | BIN | BIN БСН – бизнес-сәйкестендіру нөмірі | ✔️ |
Latvia | LV | Personal Code - Personas kods | PVN (Pievienotās vērtības nodokļa, Latvian VAT number) | PVN (Pievienotās vērtības nodokļa, Latvian VAT number) | ✔️ |
Lithuania | LT | Personal Code - Asmens kodas | PVM (Pridėtinės vertės mokestis mokėtojo kodas, Lithuanian VAT number) | ✔️ | |
Luxembourg | LU | Personal identification code (PIC) | TVA (taxe sur la valeur ajoutée, Luxembourgian VAT number) | ✔️ | |
Malta | MT | Identity Card Number | VAT Number | ✔️ | |
Monaco | MC | ❌ | VAT Number | VAT Number | ✔️ |
Moldova | MD | IDNP (Identification Number of Person) | Validate VAT code (Nr. de Inregistrare TVA) | ✔️ | |
Montenegro | ME | ✔️ | |||
Macedonia | MK | Vat Number | ✔️ | ||
Mauritius | MU | ID number (Mauritian national identifier) | ✔️ | ||
Netherlands | NL | Burgerservicenummer (BSN) - Citizen Service Number or Onderwijsnummer | Omzetbelastingnummer (BTW) | ✔️ | |
Norway | NO | ✔️ | |||
New Zealand | NZ | ✔️ | |||
Peru | PE | RUC | RUC Peruvian company tax number | RUC Peruvian company tax number | ✔️ |
Philippines | PH | ✔️ | |||
Pakistan | PK | CNIC (Computerized National Identity Card) | ✔️ | ||
Poland | PL | Polish National Identification Number (PESEL) | Numer Identyfikacji Podatkowej (NIP) | ✔️ | |
Portugal | PT | Número de identificação civil - NIC | Numero de Identificacao Fiscal (NIF) | ✔️ | |
Paraguay | PY | Registro Unico de Contribuyentes (RUC) | Registro Unico de Contribuyentes (RUC) | Registro Unico de Contribuyentes (RUC) | ✔️ |
Romania | RO | Cod Numeric Personal - Personal Numerical Code (CNP) | Cod fiscal TVA | Cod fiscal | ✔️ |
Serbia | RS | Unique Master Citizen Number JMBG | ✔️ | ||
Russia | RU | Taxpayer Personal Identification Number (INN) | VAT Number | VAT Number | ✔️ |
Slovakia | SK | Rodné Císlo (RČ) | Identifikačné číslo pre daň z pridanej hodnoty (IČ DPH) | ✔️ | |
Slovenia | SI | Unique Master Citizen Number JMBG | Identifikacijska številka za DDV | ✔️ | |
San Marino | SM | COE (Codice operatore economico, San Marino national tax number) | COE (Codice operatore economico, San Marino national tax number) | COE (Codice operatore economico) | ✔️ |
El Salvador | SV | NIT (Número de Identificación Tributaria, El Salvador tax number) | ✔️ | ||
Thailand | TH | Thailand citizen number | ✔️ | ||
Turkey | TR | T.C. Kimlik No. (Turkish personal identification number) | VKN (Vergi Kimlik Numarası, Turkish tax identification number) | VKN (Vergi Kimlik Numarası) | ✔️ |
Taiwan | TW | SSN | ❌ | ❌ | ✔️ |
Spain | ES | DNI/NIF/NIE | NIF / CIF | NIF / CIF | ✔️ |
Switzerland | CH | AHV (Sozialversicherungsnummer) | VAT, MWST, TVA, IVA, TPV (Mehrwertsteuernummer, the Swiss VAT number). | UID Unternehmens-Identifikationsnummer | ✔️ |
Sweden | SE | Personnummer - Personal Identity Number | VAT-nummer or momsnummer | Orgnr (Organisationsnummer, Swedish company number) | ✔️ |
United States | US | Social Security Number | Not Supported | EIN | ✔️ |
Ukraine | UA | Social Number | VAT | VAT | ✔️ |
Uruguay | UY | RUT numbers | RUT numbers | RUT numbers | ✔️ |
Venezuela | VE | Registro de Informacion Fiscal (RIF) | Registro de Informacion Fiscal (RIF) | Registro de Informacion Fiscal (RIF) | ✔️ |
South Africa | ZA | Social Number | VAT Code | VAT Code | ✔️ |
<a href="https://www.buymeacoffee.com/valentinanghel" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" style="height: 51px !important;width: 217px !important;" ></a>
License
Copyright 2020 Anghel Valentin
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
Special thanks
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.8
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on FabriceAv.CountryValidator:
Package | Downloads |
---|---|
FabriceAv.CountryValidator.DataAnnotations
DataAnnotations to validate VAT codes, social security numbers or tin numbers. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.1.4 | 239 | 3/14/2024 |