Closed LucianPetri closed 3 years ago
You can use change alphabet and use RegExp to add -
on special position.
But will you really need Nano ID for this case?
The core idea of Nano ID is to use shorter string compare to UUID. With same alphabet and dashes, you will lose most of Nano ID benefits.
My focus is to improve project dependencies by replacing current libraries with smaller and faster ones, in this case, with the usage of uuidv4, we have a requirement to use guid for it needs too many project structures to be changed while maintaining the already built infrastrucure.
Even though I personally am not a fan of so many detailed requirements there are more underlying barriers from which these projects stem.
my only option right is to use nanoid as usual where there is no need for a specific format of the id and add RegExp custom alphabet where it's required.
Thank you for the clarification!
The size and performance difference with uuidv4
do not enough for the migration.
Especially, because Nano ID with new alphabet and dashes will not be a valid UUID v4 (it has special bits in ID).
Feature Request
big companies like the one I work for like to strongly type everything, one of those things is also the ID type of database objects, I would like to change all my uuidv4 usage with nanoid but the problem is that in most of the projects there's a specific ID format type expected. I can't safely change to nanoid yet since it will break most of the projects since it does not generate GUID format like random ID.