Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add capital letters to name generator in upload.php #20

Open
mrjkuhl opened this issue Sep 29, 2014 · 8 comments
Open

Add capital letters to name generator in upload.php #20

mrjkuhl opened this issue Sep 29, 2014 · 8 comments

Comments

@mrjkuhl
Copy link

mrjkuhl commented Sep 29, 2014

This would increase the range of possible names by a wide margin, and so would be beneficial to a growing fiie host.

@NuckChorris
Copy link
Collaborator

there were capitals previously but math has occurred and determined that the current range is plenty. Additionally, adding capitals makes it harder to type manually. Perhaps adding digits would be better?

@mrjkuhl
Copy link
Author

mrjkuhl commented Sep 29, 2014

@NuckChorris , a simple way to avoid mathematical problems with using capital and lower case letters would be to do a preroll before determing the letter set chosen from. This could be done by calling mt_rand(0, 1) within an if function. If the result is 0, then a range of A-Z letters would be chosen from. If the result is 1, the letters chosen from would be a-z.

This is of course assuming that your math problems were from non-english characters being selected, as there are some of those sitting between Z and a on the ascii table ([, , ], ^, _, and `).

@mrjkuhl
Copy link
Author

mrjkuhl commented Sep 29, 2014

@NuckChorris , I should also add that numerals can be taken into account as well, though the range of the roll would be have to expanded to 0-30, I believe, to get proper representation between all of the possible characters.

@NuckChorris
Copy link
Collaborator

There's no math problems, I simply said we ran the numbers and found the current set sufficient for now until we can produce something hugely better

@NuckChorris
Copy link
Collaborator

That ^ there's no reason to add substantially more because we only have a few hundred thousand files last I checked. 300 million names is plenty for now. Maybe we'll add 0-9 and then it'll be 36^6, but mixed case makes transcription of URLs hard.

@zebracanevra
Copy link

I deleted my comment because I thought maybe my math was wrong, but no, I'm right, ~308 million filenames.

I'd say as long as you fill less than 1% of those you should be fine. That's to prevent brute forcing the uploads. Maybe once 2 million files are uploaded a larger set should be chosen

@nokonoko
Copy link
Owner

Around 1,500,000+ are uploaded as of now, so change it around 2 million so it's harder to bruteforce?

@thehowl
Copy link

thehowl commented Apr 22, 2015

I guess you could add one letter, to get to 8,031,810,176 possible combinations. Even if we'd try to fill 1% of it, it would require 80,318,102 which can host 53 times the current number of uploaded files, approximately.

Or if we're evenfags and we'd want to increase it to 8, it would come to 208,827,064,576 possible combinations. To fit a 1% of it it would require 2,088,270,645 files, approximately 1392 times the current number of files. At that point pomf would have been already bought by Yahoo!.

So ¯_(ツ)_/¯ - whether one you choose it's kind of hard to reach than quantity of numbers.

(EDIT: lol markdown fucking up muh ¯_(ツ)_/¯ )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants