DEV Community

Discussion on: Making random ID with Javascript

Collapse
david_brear_dc8676f75b6d4 profile image
David Brear

As a proof-of-concept or coding challenge, this is okay but DO NOT DO THIS IN A PRODUCTION ENVIRONMENT!!!! If you need random, unique IDs use uuid packages from npm. There’s a saying “don’t reinvent the wheel” especially when your “wheel” is a less-good version.

For production systems don’t: roll your own encryption, roll your own auth (unless you REALLY REALLY REALLY know what you’re doing), roll your own ID generation.

If you do any of the above YOU WILL BE HACKED.