mazipan / tanyaaja.in

❓Kumpulkan pertanyaan secara anonim dari siapa saja dengan mudah
https://tanyaaja.in
MIT License
138 stars 38 forks source link

Shorter nanoid for question #46

Closed mazipan closed 1 year ago

mazipan commented 1 year ago

Is your feature request related to a problem? Please describe. When submitting question, we generate a random id using nanoid, but it still generating too long ID (around 21char).

Even though it is better, I guess for our case it's better to generate shorter id instead.

Describe the solution you'd like

See https://github.com/steven-tey/dub/blob/main/packages/utils/src/index.ts#L65-L68

theodorusclarence commented 1 year ago

i can take this

theodorusclarence commented 1 year ago

@mazipan can I ask why the need of customAlphabet? i believe nanoId is already URL safe and we can just call nanoid(7)

mazipan commented 1 year ago

Not sure, just found out that dub using it. Maybe to eliminate the special char such as -, _, etc. No preference from me