SwedishIdentityNumbers 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SwedishIdentityNumbers --version 1.0.0                
NuGet\Install-Package SwedishIdentityNumbers -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="SwedishIdentityNumbers" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SwedishIdentityNumbers --version 1.0.0                
#r "nuget: SwedishIdentityNumbers, 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.
// Install SwedishIdentityNumbers as a Cake Addin
#addin nuget:?package=SwedishIdentityNumbers&version=1.0.0

// Install SwedishIdentityNumbers as a Cake Tool
#tool nuget:?package=SwedishIdentityNumbers&version=1.0.0                

SwedishIdentityNumbers

A .NET library for working with Swedish identity numbers.

Overview

The SwedishIdentityNumbers library provides a set of classes for working with Swedish identity numbers:

  • Personnummer for personal identity numbers
  • Samordningsnummer for coordination numbers
  • Organisationsnummer for organization numbers

Each of these classes inherits from the abstract base class SwedishIdentityNumber, which provides common functionality for validating and working with identity numbers.

Installation

Install SwedishIdentityNumbers via NuGet:

dotnet add package SwedishIdentityNumbers

Or search for SwedishIdentityNumbers in the NuGet package manager in Visual Studio.

Usage

Create a Personnummer

using SwedishIdentityNumbers;

var personnummer = new Personnummer("198507301234");

Try to create a Personnummer

using SwedishIdentityNumbers;

if (Personnummer.TryCreate("198507301234", out var personnummer))
{
    // Successfully created
}

Create a Samordningsnummer

using SwedishIdentityNumbers;

var samordningsnummer = new Samordningsnummer("198507301234");

Validate an identity number

using SwedishIdentityNumbers;

var isValid = new Personnummer("198507301234").IsValidFormat();

Development

To work on SwedishIdentityNumbers, clone the repo and open SwedishIdentityNumbers.sln in Visual Studio or your preferred editor.

Testing

Run the tests in SwedishIdentityNumbers.Tests to ensure everything is working correctly.

License

SwedishIdentityNumbers is licensed under the MIT License. See the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.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.3 6,390 11/3/2023
1.0.2 105 11/2/2023
1.0.1 103 11/2/2023
1.0.0 110 11/2/2023

First release of SwedishIdentityNumbers.