Gargron / fileupload

PHP FileUpload library that supports chunked uploads
MIT License
460 stars 87 forks source link

Enhancement: FileNameGenerator\Hash #54

Closed Indigo744 closed 7 years ago

Indigo744 commented 7 years ago

If I may suggest a nice enhancement.

Get rid of FileNameGenerator\MD5 class and add a FileNameGenerator\Hash class which accept:

  1. A hashing algorithm name, as expected by the hash() function (PHPDoc), and as listed by hash_algos() (PHPDoc)
  2. An optional salt string, for avoiding collision attack (e.g. in case the hashed name is made public)
  3. An optional allowOverride boolean

This will allow a lot more flexibility. What do you think?

adelowo commented 7 years ago

Nice suggestion... I should work on it..

But i think it is just safer to mark the MD5 class as deprecated instead

adelowo commented 7 years ago

Update --> I feel this is just too much work to be added to the library and feels kind of better having users do something like this themselves..

Thanks a lot for your contributions