Closed andreluizsgf closed 1 year ago
Hi, i want to use nanoid to generate some random ids but would like to check if a given string is nanoid and then query for it in a database. is this validation possible?
I think /[\w_-]{21}/.test(id) should work
/[\w_-]{21}/.test(id)
I was also looking for a validator. Is there a method added for this or does the above Regex work properly? @ai
Yes, it should works.
Hi, i want to use nanoid to generate some random ids but would like to check if a given string is nanoid and then query for it in a database. is this validation possible?