ai / nanoid

A tiny (124 bytes), secure, URL-friendly, unique string ID generator for JavaScript
https://zelark.github.io/nano-id-cc/
MIT License
24.22k stars 790 forks source link

Best way to generate initial ids? #431

Closed matthew-dean closed 1 year ago

matthew-dean commented 1 year ago

In HTML / CSS, identifiers can be alphanumeric but MUST start with [A-Za-z]. (Well, CSS identifiers can also have a dash prefix, but for the sake of argument, lets say this is aligned.

I realize I can pass an alpha dictionary to nanoid to only use alpha characters, but could you add a feature of easily specifying this format, so that I can generate valid IDs for <label for={id}> <input id={id}> pairings?