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

Conflict with Passenger and Node Cluster module #142

Open sumpton opened 5 years ago

sumpton commented 5 years ago

Passenger is generating an error

You required the Node Cluster module, which is incompatible with Passenger, a non-functional shim was returned and your app may still work. However, please remove the related code as soon as possible.

node_modules/shortid/lib/util/cluster-worker-id.js:3:15

Does anyone know if this is safe to ignore, or of a work around?

ai commented 5 years ago

Do not use ShortID, it is deprecated and unsafe.

Use https://github.com/ai/nanoid/

sumpton commented 5 years ago

@ai thank you for helping.

beppe9000 commented 4 years ago

Do not use ShortID, it is deprecated and unsafe.

Use https://github.com/ai/nanoid/

But nanoid is a dependency of this package...

ai commented 4 years ago

@beppe9000 yeap, I as a maintainer of both libraries used Nano ID to solve some problem of short ID with distribution and performance.

But to fix all problems we will need breaking changes in API (dynamic ID length is one of problem). It will be hard to do it, much better just to migrate to Nano ID, which is smaller, safer and faster.