2 ms·
Show HN: Roll for ID, HTTP service to get random identifiers in scripts
- fpgaminer 8y agoI often need random identifiers, e.g. for naming Google Compute instances. Especially in provisioning scripts. Usually I just hack some shell commands together to grab a random string, but I thought random phrases would be more interesting. So instead of "rwlofh8fbvfkeu31fgfo" I wanted "gibraltar-salad-painting". So, I built a script to do that, and to make things super convenient I turned it into an HTTP service. You can just `curl https://roll-for-id.appspot.com/id` https://roll-for-id.appspot.com/id` in an automated script whenever you need an identifier. Yes, it's a little silly. You can get a poor man's version with Unix's words file and `shuf`. But I actually ended up liking the conveneince of just curling a URL. Especially since it automatically handles minimum entropy calculation, when needed (https://roll-for-id.appspot.com/id?entropy=128 https://roll-for-id.appspot.com/id?entropy=128).