I want to randomly assign a 4-digit ID to every respondent with no repeats (we anticipate ~500 responses). How could I set this up?
Page 1 / 1
Unfortunately, the random number generator ${rand://int/1000:9999} cannot guarantee no repeats. You'd have to set up a web service to a designated URL. (And your license would have to have API access) I've been searching for a Web Service to no avail. If anyone can suggest one, I'd appreciate it! So need this!
One thing I would use is a library that generates IDS. I have been using short-unique-id (https://www.npmjs.com/package/short-unique-id) for my surveys to put them in Batches.
I haven't thoroughly tested its abilities to create 100% unique ID's every time, and so I might look for a better library if you absolutely have to make sure they're unique. I trust it, but don't take my word for it.
This library is hosted via a pseudo CDN (Raw Git) so you can test it, but if you do use it, I would include the script in your project's code for safety.
I haven't thoroughly tested its abilities to create 100% unique ID's every time, and so I might look for a better library if you absolutely have to make sure they're unique. I trust it, but don't take my word for it.
This library is hosted via a pseudo CDN (Raw Git) so you can test it, but if you do use it, I would include the script in your project's code for safety.
A web service would be the best way to guarantee uniqueness.
In a past project, I knew of someone who used https://www.random.org/integer-sets/, which uses Atmospheric Noise to generate random numbers. It's way over the top, but I thought it was pretty cool!
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.