WilvanBil.NationalRegisterNumber 1.0.1

.NET 6.0
dotnet add package WilvanBil.NationalRegisterNumber --version 1.0.1
NuGet\Install-Package WilvanBil.NationalRegisterNumber -Version 1.0.1
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="WilvanBil.NationalRegisterNumber" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WilvanBil.NationalRegisterNumber --version 1.0.1
#r "nuget: WilvanBil.NationalRegisterNumber, 1.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install WilvanBil.NationalRegisterNumber as a Cake Addin
#addin nuget:?package=WilvanBil.NationalRegisterNumber&version=1.0.1

// Install WilvanBil.NationalRegisterNumber as a Cake Tool
#tool nuget:?package=WilvanBil.NationalRegisterNumber&version=1.0.1

National Register Number

National Register Number is a package that can generate and validate Belgian national register numbers. The logic is based on Official Documentation by the Belgian Government

Installation

dotnet add package WilvanBil.NationalRegisterNumber --version 1.0.0
Or through a packet reference:
<PackageReference Include="WilvanBil.NationalRegisterNumber" Version="1.0.0" />
Or search it on NuGet Package Manager.

Usage

After installation you can use the static class NationalRegisterNumberGenerator to generate or validate your national register numbers.

Validate

This will return true or false based on input.

NationalRegisterNumberGenerator.IsValid(string here)

Generate

This will return a string that's a valid national register number. Following overloads are possible on NationalRegisterNumberGenerator.Generate()

Generate()
Generate(DateTime birthDate)
Generate(BiologicalSex sex)
Generate(DateTime birthDate, BiologicalSex sex)
Generate(DateTime minDate, DateTime maxDate)
Generate(DateTime minDate, DateTime maxDate, BiologicalSex sex)
Generate(DateTime birthDate, int followNumber)

followNumber is a number (inclusive) between 1 and 998. If your parameters are invalid, it will throw an ArgumentException with a message why Generate() has failed. Keep in mind that the absolute minDate is 1900/01/01 and the absolute maxDate is Datetime.Today on the time that the code runs. If you pick a date outside this range, it will also throw an ArgumentException.

!!WARNING!!

Only use the package for test and research purposes. Do not use it in a live/production environment. It should only be used for unit/integration testing.

Product Versions
.NET net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • net6.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.1 133 9/19/2022
1.0.0 174 9/14/2022