OdoID 1.0.2

dotnet add package OdoID --version 1.0.2
                    
NuGet\Install-Package OdoID -Version 1.0.2
                    
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="OdoID" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OdoID" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="OdoID" />
                    
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 OdoID --version 1.0.2
                    
#r "nuget: OdoID, 1.0.2"
                    
#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 OdoID@1.0.2
                    
#: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=OdoID&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=OdoID&version=1.0.2
                    
Install as a Cake Tool

OdoID

Deterministic mixed-radix ID encoding. Maps a ulong to a 6, 7, or 8-character alphanumeric string with a serial-number aesthetic.

OdoId.Encode(0,            6)  →  "0A0000"
OdoId.Encode(1234567,      6)  →  "0D7NM7"
OdoId.Encode(1234567,      7)  →  "0A15NM7"
OdoId.Encode(236223201279, 8)  →  "ZZ9ZZZZZ"

Features

  • Deterministic — same integer + length always produces the same string, and vice-versa.
  • Human-readable — ambiguous characters I, L, O are excluded from all positions.
  • Fixed positional structure — position 1 is always a letter, position 2 is always a digit.
  • Zero dependencies — pure .NET standard library only.
  • Multi-targetnet8.0, net6.0, netstandard2.1.

Install

dotnet add package OdoID

Usage

Encode

using OdoID;

OdoId.Encode(0, 6);            // "0A0000"
OdoId.Encode(1234567, 6);      // "0D7NM7"
OdoId.Encode(1234567, 7);      // "0A15NM7"
OdoId.Encode(236223201279, 8); // "ZZ9ZZZZZ"

Default length is 6:

OdoId.Encode(0); // "0A0000"

Decode

OdoId.Decode("0A0000");    // 0UL
OdoId.Decode("0D7NM7");    // 1234567UL

Returns ulong. Input is uppercased before lookup, so "0d7nm7" is valid.

OdoIDGenerator

var g = new OdoIDGenerator(new GeneratorConfig
{
    Namespace = "orders",
    Length    = 7
});

var result = g.Next();
// result.Id        → e.g. "3H5NV2K"
// result.N         → the raw ulong
// result.Length    → 7
// result.Namespace → "orders"

Lengths and Capacity

Length Max integer (exclusive)
6 230,686,720
7 7,381,975,040
8 236,223,201,280

Exceptions

Exception When
OdoOverflowException n >= Max[length]
UnsupportedLengthException length is not 6, 7, or 8
InvalidCharacterException character not in positional charset during decode

All are subclasses of ArgumentOutOfRangeException or ArgumentException.

Run tests

dotnet test

Specification

See SPEC.md for the full processing instruction document.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.
  • net6.0

    • No dependencies.
  • 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.2 93 5/7/2026
1.0.1 91 5/6/2026
1.0.0 84 5/6/2026

Initial release.