simplyhexagonal/short-unique-id

Validate UUID

irfancnk opened this issue ยท 2 comments

Hi, is there a way to validate whether a given string is valid UUID, according to its generator, if not, is it possible to add that as a new feature?

Version 5 was just released. It has better dictionary handling, thus would make it simple to validate that a short UID contains only characters from a given dictionary.

For this validation to work there would be two assumptions made:

  • You know the original dictionary the UID was generated with
  • The ShortUniqueId instance performing the validation is using the original dictionary, or the validate() function can be told which dictionary to validate against

We will explore implementing this functionality in the following weeks and update this issue as we progress.

Thanks for your contribution @irfancnk ๐Ÿ‘๐Ÿผ

This feature has been implemented, you can find the documentation at:

https://shortunique.id/#md:ability-to-validate-uuids-against-the-instance-dictionary-or-a-provided-dictionary

Cheers โœŒ๐Ÿผ