I want to use the auto-incremented id
in URI
to locate resources, but I don’t want the auto-incremented id
to be used every time< code>+1, but I hope it is a random number as id
, but this id
is proportional.
What I think of so far One solution is to use timestamps. Is there any other solution?
Please indicate the programming language when answering
JavaScript
01
Timestamp
Another possible approach
uuid
https://www.npmjs.com/package...
Use
uuidV1
Generate a random number that does not repeat. Use
•srand() - Seeds a random number generator
•getrandmax() - Displays the largest possible value of a random number
•mt_rand() - Generates better random numbers
These three functions.