How to generate random SHA1 hash to use as ID in node.js?
-
29-10-2019 - |
Question
I am using this line to generate a sha1 id for node.js:
crypto.createHash('sha1').digest('hex');
The problem is that it's returning the same id every time.
Is it possible to have it generate a random id each time so I can use it as a database document id?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow