Ananoid
This library provides nano identifiers, an alternative to UUIDs (inspired by https://github.com/ai/nanoid).
Overview
A nano identifier, or nanoid, is a randomly generated opaque value, suitable for uniquely identifying database entries, file names, et cetera. Ananoid (pronounced: "an-an-oyd") is a library for generating such identifiers. It uses cryptographically secure random number generation, and has no dependencies beyond the .NET 8 base class libraries. It has both a high-level API, and a simpler, more memory-efficient, low-level API.
Installation via NuGet
The latest version of this package can be installed from NuGet via the following command:
A simple example
The most common use-case for this library is to generate an new identifier, based on sensible defaults (21 random characters from a URL-safe alphabet consisting of: letters, numbers, underscore, and/or hyphen). A struct representing such an identifier can be generated as follows:
Further reading
Copyright
The library is available under the Mozilla Public License, Version 2.0. For more information see the project's License file.
val string: value: 'T -> string
--------------------
type string = System.String
ananoid