PrettyId 1.0.0.4
See the version list below for details.
dotnet add package PrettyId --version 1.0.0.4
NuGet\Install-Package PrettyId -Version 1.0.0.4
<PackageReference Include="PrettyId" Version="1.0.0.4" />
paket add PrettyId --version 1.0.0.4
#r "nuget: PrettyId, 1.0.0.4"
// Install PrettyId as a Cake Addin #addin nuget:?package=PrettyId&version=1.0.0.4 // Install PrettyId as a Cake Tool #tool nuget:?package=PrettyId&version=1.0.0.4
PrettyId
PrettyId is a simple library for creating uniform IDs similar to those used by Stripe.
Under the hood, PrettyId uses base64 strings of GUIDs to generate a random identifier of the specified length. You can choose to set a prefix that can be included in the result.
New in v1.0.0
- Initial release
Help or feedback
First things first - do you need help or have feedback? File an issue here!
Performance and Security
It's pretty quick 😃 The shorter the list of allowed characters, the slower it will run.
On security, the library has no way to guarantee that it will never issue the same ID twice. It is however based on GUIDs, which have a ridiculously low theoretical probability of collision (I would encourage you to check out Stephen Cleary's blog post at https://blog.stephencleary.com/2010/11/few-words-on-guids.html)
Simple Example
using PrettyId;
Console.WriteLine(IdGenerator.Generate("data_", 32));
// data_0mAg6shuO0GSplEn7GmXR
Console.WriteLine(IdGenerator.Generate(64));
// KL5ULxfC2kujhcMtDKnDKgUAANsBAdESqJBDKIgvLwdxfjo03uJEKLkn9csMt4Q
Console.WriteLine(IdGenerator.Generate());
// 5wS4rcgWk6Tr0CO0sfXgA0NAtlOp60C
Want to set the list of valid characters?
IdGenerator.ValidCharacters = new char[] { 'a', 'b', 'c', 'd', ... };
Note With fewer characters, it will take longer to generate an ID, and there is a mechanism internally to iterate over new GUIDs a maximum of MaxIterations
times. If this number of iterations is exceeded, an exception will be thrown. Additionally, only valid base64 characters should be included in the list.
Product | Versions 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 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. 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. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
.NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
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. |
-
.NETFramework 4.6.1
- No dependencies.
-
.NETFramework 4.8
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on PrettyId:
Package | Downloads |
---|---|
S3Server
Emulated Amazon Web Services (AWS) Simple Storage Service (S3) server-side interface. |
|
LiteGraph
LiteGraph is a simple graph database abstraction with a RESTful interface, JSON data query support, and GEXF output support. |
|
S3Lite
Lightweight Amazon S3 client without all the heft and dependency drag of the official library. |
|
LiteGraph.Sdk
SDK for LiteGraph, a simple graph database abstraction with a RESTful interface, JSON data query support, and GEXF output support. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Strong naming.