Veritas 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Veritas --version 1.0.0
                    
NuGet\Install-Package Veritas -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Veritas" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Veritas" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Veritas" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Veritas --version 1.0.0
                    
#r "nuget: Veritas, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Veritas@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Veritas&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Veritas&version=1.0.0
                    
Install as a Cake Tool

Veritas

Core primitives and algorithms for identifier validation and generation.

Currently implemented

Algorithms

  • Luhn (mod 10)
  • ISO 7064 (mod 11,10; mod 97; mod 37,2)
  • GS1 mod 10
  • Weighted mod 11 variants
  • ISO 6346 container check digit
  • MRZ (ICAO 9303 7-3-1 pattern)
  • Base58Check codec

Finance

  • IBAN validation (ISO 13616 / ISO 7064 mod 97)
  • BIC/SWIFT code structural validation
  • ISIN validation (alphabetic + numeric with Luhn check digit)
  • ISO 11649 RF creditor reference validation and generation
  • Payment card PAN validation (Luhn)
  • US ABA routing number validation
  • Mexican CLABE validation and generation
  • Legal Entity Identifier (LEI) validation and generation
  • SEDOL validation and generation
  • CUSIP validation and generation
  • Market Identifier Code (MIC) structural validation
  • German WKN structural validation

Energy

  • Energy Identification Code (EIC) validation and generation (ISO 7064 mod 37,2)
  • Great Britain MPAN core validation and generation
  • Great Britain MPRN validation
  • Netherlands Energy EAN validation and generation
  • Spain CUPS validation and generation
  • Germany MaLo validation and generation
  • Germany MeLo validation and generation
  • Germany ZPN validation and generation
  • France PRM validation
  • Italy POD structural validation
  • Italy PDR structural validation

Identity

  • UUID/GUID validation and generation
  • Email address validation
  • ULID validation and generation
  • NanoID validation and generation
  • Phone number (E.164) validation
  • Domain name validation
  • KSUID validation and generation
  • BCP 47 language tag validation
  • Ethereum address validation
  • Base58Check validation and generation

Tax

  • Brazil CPF validation/generation
  • Brazil CNPJ validation/generation
  • Germany USt-IdNr validation/generation
  • Germany IdNr validation/generation
  • Canada SIN validation/generation
  • Canada Business Number validation/generation
  • United States SSN structural validation and generation
  • United Kingdom NINO structural validation
  • United Kingdom UTR checksum validation
  • United Kingdom VAT checksum validation
  • United Kingdom Company Number structural validation
  • United States EIN prefix validation
  • United States ITIN structural validation
  • Australia TFN checksum validation/generation
  • Australia ABN checksum validation/generation
  • India PAN validation/generation
  • France SIREN validation
  • France SIRET validation
  • France VAT checksum validation
  • Italy VAT (PIVA) checksum validation
  • China USCC validation/generation
  • Spain NIF checksum validation
  • Spain NIE checksum validation
  • Spain CIF checksum validation
  • Netherlands BSN checksum validation
  • Netherlands VAT (BTW) checksum validation
  • Poland NIP checksum validation
  • Poland REGON checksum validation
  • Poland PESEL checksum validation
  • Sweden Personnummer checksum validation
  • Sweden OrgNr checksum validation
  • New Zealand IRD checksum validation

Logistics

  • GTIN/EAN/UPC validation and generation (GS1 mod 10)
  • Global Location Number (GLN) validation and generation
  • Serial Shipping Container Code (SSCC) validation and generation
  • Vehicle Identification Number (VIN) validation
  • ISO 6346 container code validation
  • Air Waybill (AWB) validation and generation
  • IMO ship identification number validation and generation

Telecom

  • IMEI validation and generation
  • MEID validation and generation
  • ICCID validation and generation
  • MAC address validation and generation
  • OUI validation and generation
  • ASN validation and generation
  • IPv4 structural validation
  • IPv6 structural validation

Education & Media

  • ISBN-10 validation and generation
  • ISBN-13 validation and generation
  • ISSN validation and generation
  • DOI structural validation
  • ISNI validation and generation
  • ISMN validation and generation
  • ISRC structural validation

Healthcare

  • NHS Number validation and generation
  • ORCID validation and generation

Additional identifiers and algorithms will be added per the PRD.

Example usage

// Validate an IBAN
Finance.Iban.TryValidate("FR14 2004 1010 0505 0001 3M02 606", out var iban);
Console.WriteLine(iban.IsValid);            // True
Console.WriteLine(iban.Value!.Value);       // FR1420041010050500013M02606

// Generate a GTIN-13
foreach (var s in Bulk.GenerateMany((dst, rng) => {
    var ok = Logistics.Gtin.TryGenerate(13, new GenerationOptions { Seed = rng.Next() }, dst, out var w);
    return (ok, w);
}, count: 3, seed: 42))
{
    Console.WriteLine(s);
}

// Validate a telecom identifier
Telecom.Imei.TryValidate("490154203237518", out var imei);
Console.WriteLine(imei.IsValid);            // True

Project structure

src/Veritas/          core library organised by domain
  Core/              shared primitives and algorithms
  Finance/           financial identifiers
  Tax/               national and regional tax identifiers
  Energy/            electricity and gas identifiers
  Identity/          software and personal identifiers
  Logistics/         supply chain identifiers
  Healthcare/        health identifiers
  Telecom/           network and telecom identifiers
  Education/         research and publishing identifiers
  Media/             media identifiers

test/Veritas.Tests/   xUnit test suite

Adding new identifiers

  1. Add a new static class <IdName> in the appropriate domain with TryValidate and, when safe, TryGenerate methods.
  2. Include a value type <IdName>Value containing the normalized representation.
  3. Add unit tests under test/Veritas.Tests verifying valid and invalid cases.
  4. Update the PRD and this README with the new identifier and its capabilities.
  5. Run dotnet test -f net8.0 and ensure all tests pass.

Contributing

Contributions are welcome! Fork the repository, create a topic branch, and open a pull request:

  1. Describe the motivation and design in the PR description.
  2. Ensure tests and formatting checks pass.
  3. The maintainers will review and merge when ready.

Continuous integration via GitHub Actions restores dependencies, builds, and runs the test suite on every push and pull request. Packages are produced by the publish workflow and releases are drafted automatically.

Product Compatible and additional computed target framework versions.
.NET 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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.5 222 9/15/2025
1.0.4 118 9/13/2025
1.0.3 121 9/12/2025
1.0.2 136 9/11/2025
1.0.1 142 9/9/2025
1.0.0 136 9/9/2025