Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Roll for ID, HTTP service to get random identifiers in scripts (roll-for-id.appspot.com)
1 point by fpgaminer on June 18, 2018 | hide | past | favorite | 1 comment


I 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` 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).




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: