4 ms·
Show HN: r.ger.lv – simple random string generation
- gerlv 10y agoI've implemented a small tool for generating random strings, maybe someone else will find it useful. - r.ger.lv - default is 20 characters [a-zA-Z0-9] - r.ger.lv/<len> <len> of [a-zA-Z0-9] - r.ger.lv/s-<len> <len> of [a-zA-Z0-9_+-.,!@#$%^&*();\/|"'] `curl -L r.ger.lv/25` - if you want to run from the terminal. More info: https://www.ger.lv/simple-random-string-generation/ https://www.ger.lv/simple-random-string-generation/
- brudgers 10y agoMy general concern with this type of service is that the strings could wind up directly in a rainbow table and that might defeat one of the reasons for using it. Not an accusation, just an observation about the limits of the service. Good luck.
- stephenr 10y agoSo, I was joking when I said the next thing will be `println as a service`. This is not helping to disprove that prediction. What language doesn't have random string generation available either as a standard part of the runtime, or as a reliable library?
- moridin007 10y agobut is it really random or pseudorandom? i feel that services like these can be useful to introduce a higher level of entropy to your own local random number library
- stephenr 10y ago> i feel that services like these can be useful to introduce a higher level of entropy to your own local random number library They just use /dev/urandom + sha512, and them capitalise some characters. You can pipe /dev/urandom input into any number of tools locally to get random strings - base64 is nice as it gives you a wider range of characters.
- gerlv 10y agoguys, I think you over-estimate what this tool does. It's not a saas or something to be integrated with projects. The only reason I've made it is to avoid creating random strings every time I need them. In the past few months I've done the following at least 5 times: 1) run ipython 2) run the following code: import os import hashlib print(hashlib.sha512(os.urandom(128)).hexdigest()) The problem that it takes unnecessary time to do it. `curl -L r.ger.lv` is way simpler and faster for the same result. In fact, it's exactly the same code that's running on this site :) It's a small tool so you have fewer excuses to leave `SECURE_STRING = "TODO_CHANGEME"` in settings files. I did this tool mainly for myself, thought I'd share it, maybe someone finds it useful.
- stephenr 10y ago> guys, I think you over-estimate what this tool does I don't at all. That's my whole point. You've taken yet another pretty simple command line utility, and made a "web service" for it. > In the past few months I've done the following at least 5 times I've probably generated 2x that many random strings just to generate test examples for how else this could be done, compare times, etc. I didn't suddenly think that I should put that on a http server somewhere. > maybe someone finds it useful or maybe someone uses it as a source of random data for their production application because they don't know any better. You can get random strings in a shell by running `base64 /dev/urandom | head -c 30`. If you wanted to make it (or your own solution) easier, why not just create a shell script (or a python script with a shebang line). Even easier execution (i.e., tab-completion to the path), no reliance on network or a server, no security issues by loading data over a remote connection.