dylang / shortid

Short id generator. Url-friendly. Non-predictable. Cluster-compatible.
https://www.npmjs.org/package/shortid
Other
5.74k stars 258 forks source link

may generate invalid HTML id values #138

Closed bcullman closed 5 years ago

bcullman commented 5 years ago

per the HTML specification here: https://www.w3.org/TR/html4/types.html#type-id

ID and Name tokens MUST begin with a letter ([A-Za-z])

Numbers are still valid for IDs, just not as the first character.

ai commented 5 years ago
  1. This project is deprecated don’t use it. Use Nano ID
  2. For HTML ids use non-digits alphabet or put a letter on the beginning of ID id = 'id' + nanoid()

I can’t remove numbers from the begging of ID in Nano ID, since it will change symbols distribution and ID will not be secure anymore.