Both of these are libraries I built for C#, they have similar purposes but this page should hopefully help you tell what is different and what is similar between these two libraries.
Library | NuGet | GitHub |
UniqueIt | https://www.nuget.org/packages/uniqueit | https://github.com/MrBisquit/uniqueit |
WTDawson.PersistentID | https://www.nuget.org/packages/WTDawson.PersistentID | https://github.com/MrBisquit/WTDawson.PersistentID |
First of all, what do they do?
Both UniqueIt and WTDawson.PersistentID both are useful for generating IDs but they have their differences.
They both allow you to create unique identifiers based on data.
In UniqueIt, you give it a “seed”, which is a list of strings (List<string>
), an ID as an integer (int
) and the length of the identifier to be generated (int
).
In WTDawson.PersistentID, it’s a bit different, you can construct the IDBuilder
instance in many ways:
- Without any arguments
- With an array of supported objects1 as the parameters
- With a “magic”2
- With a “magic” and with an array of supported objects as the parameters
- With a “magic” and the length
- With a “magic”, the length and an array of supported objects as the parameters
There are also these rules, which can be set using the SetRules
function. You can also use SetMagic
and SetLength
to change the “magic” and length. You can also add more items via the AddItems
function.
What’s better about WTDawson.PersistentID?
WTDawson.PersistentID is newer and has more functionality. WTDawson.PersistentID allows you to make IDs more easily, it can easily be converted to a string and automatically rebuilds the ID when you request the ID (Through something like the ToString
function). It also comes with a built in PublicUtils
class which contains useful tools to filter out things such as special characters from strings.
UniqueIt is older and doesn’t filter out things such as spaces or special characters or let you choose what to include.
Which one do you think is better?
- For WTDawson.PersistentID, as of 03/02/2025, the supported objects are
string
,int
,DateTime
. ↩︎ - In WTDawson.PersistentID, a “magic” is like a key, it’s used to generate the ID. ↩︎
I’m still building on WTDawson.PersistentID so if you have any suggestions, feel free to comment them below.
Discover more from WTDawson
Subscribe to get the latest posts sent to your email.