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

Added a new function which returns a number #154

Closed Eshwar-Grandhe closed 4 years ago

Eshwar-Grandhe commented 4 years ago

It returns a random number of length 8 when called the shortid.number() only if the shortid.characters(); function is set as shortid.characters('0123456789'); @ai @dylang

ai commented 4 years ago
  1. 10 digits in 8 symbols will be not enough if the user sets cluster-ID wrong.
  2. It is better to create a new npm package for this task.