screencloud icon indicating copy to clipboard operation
screencloud copied to clipboard

Random number (or letter) generation for file name format

Open Sunako opened this issue 11 years ago • 19 comments

I'm not quite sure if the full options for file names are listed anywhere, nowhere I saw anyway, but the topic suggestion is in the interest of privacy for private hosted images. For me I usually use the yyMMddhhmmss format, making guessing a file name not all that easy for some just curious. However if someone were more interested they could easily just setup a small script to try and GET request ever increasing seconds, minutes, hours, days, etc and collect all your future (and past if they cared to do that) images. I propose some random generation option for the file naming format.

As an example of my above idea I'd use something like yyMMddhhmmss_rnd would end up 131018032250_5 for one and 131018032250_9 for the next one, that example would only happen if you somehow took two screenshots at the same second, not very likely. Making the option "stack" would be good too. For example just one"rnd" in the format produces one random number, or letter if you want, to add wherever the users puts it, but if you did "rndrnd" it would produce two, and so on.

Now obviously all this isn't needed if you are just careful not to take a screenshot of anything you wouldn't want found, or to just make sure to delete it. But sadly we are prone to forgetting things. If anything above was unclear or requires more detail I'm happy to oblige to try and fix it.

Sunako avatar Oct 18 '13 07:10 Sunako

I agree with Sunako, it would be a great feature to be able to generate some random in prefix/suffix for security.

arnaudmm avatar Nov 30 '13 10:11 arnaudmm

+1 from me.

Bubka3 avatar Dec 01 '13 02:12 Bubka3

This is a good idea, I'll see what I can do in the next version.

olav-st avatar Dec 30 '13 17:12 olav-st

What about an hash ? A simple md5 hash could be great to generate long random name for each uploads. We could use it as a prefix or suffix too.

AlyxPractice avatar Jan 04 '14 13:01 AlyxPractice

Sounds good to me as well, no reason to not have hash as an option anyway. Though prefix and suffix option is a decent idea too, since if people use dates to order their screenshots random hash only file names would throw that off.

Sunako avatar Jan 04 '14 20:01 Sunako

The new version (1.1.3) includes this. {rnd} should give you a random number, while {rnd_h} should give you a random md5 hash.

olav-st avatar Mar 17 '14 12:03 olav-st

very nice, thx! but... how can I use it in client ? %rdn or %rnd_h seems not working

arnaudmm avatar Mar 17 '14 12:03 arnaudmm

@arnaudmm What olav-st said, {rnd} and {rnd_h}.

@olav-st And as far as the hash goes, maybe just hashing the actual image would be better? Random is nice, but if someone was guessing them, the hash being that of the file or just random isn't going to make a huge difference. And I think people might like having the actual md5 of their image, could be useful for something. Just something to think about for the future.

Also, minor thing with the {rnd} random number, if you stack them like {rnd}{rnd}{rnd} etc, they seem to just produce the same random number, making them separate would make it more useful.

Thanks for the changes.

Sunako avatar Mar 17 '14 12:03 Sunako

@olav-st Thanks a lot man, that's a really great update ! But like @Sunako said, it could be great to get an hash of our screenshot. Do you have any plan about that ?

AlyxPractice avatar Mar 17 '14 14:03 AlyxPractice

@olav-st Great work!

Reinstalled ScreenCloud. I had to remove it because the screenshots weren't random.

Bubka3 avatar Mar 20 '14 21:03 Bubka3

Also, minor thing with the {rnd} random number, if you stack them like {rnd}{rnd}{rnd} etc, they seem to just produce the same random number, making them separate would make it more useful.

I might do that, but it won't be a high priority. The python code that currently does this is here if anyone wants to implement it before I do: https://github.com/olav-st/screencloud/blob/master/screencloud/res/modules/ScreenCloud.py#L16

olav-st avatar Mar 22 '14 20:03 olav-st

Hi, The {rnd} command appears to be biased. I tried it for FTP uploading but it ended up not creating any files above 8.jpg and also overwrote the old ones a few times. {rnd_h} does not have such a problem however the string is long which isn't great.

classic-ally avatar May 09 '14 05:05 classic-ally

I tried it for FTP uploading but it ended up not creating any files above 8.jpg

Strange, what OS are you using? It generates numbers from 0-9 on my Windows machine.

olav-st avatar May 15 '14 17:05 olav-st

Windows 8.1. Still, only numbers 0-9 is not really viable for a server with ~300 uploads per day. — Sent from iOS

On Thu, May 15, 2014 at 10:36 AM, olav-st [email protected] wrote:

I tried it for FTP uploading but it ended up not creating any files above 8.jpg

Strange, what OS are you using? It generates numbers from 0-9 on my Windows machine.

Reply to this email directly or view it on GitHub: https://github.com/olav-st/screencloud/issues/10#issuecomment-43240786

classic-ally avatar May 16 '14 15:05 classic-ally

Bumping this as I still want to be able to stack {rnd} and make it that it won't overwrite my current files. Also a random hexadecimal would be nice.

celebrir avatar Oct 16 '14 22:10 celebrir

Just a quick update on this looking at the source code using {rnd_s} is what you guys are after.

ghost avatar Mar 01 '15 22:03 ghost

@thispixel You're my hero! ❤❤❤❤❤❤❤❤❤❤

celebrir avatar Mar 02 '15 08:03 celebrir

Any progress?

ilyahoilik avatar Jan 11 '18 21:01 ilyahoilik

This issue has had no activity in the last 60 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed after 30 days.

github-actions[bot] avatar May 14 '24 02:05 github-actions[bot]