Not withstanding afoken's very good points above, the OP is combining his random number with part of the original filename.
I was suggesting he do the same with the MD5, which covers the possibility of there being two copies of the same content under different names in the same directory.
I would also combine the file length into the derived number, as probabilistically, each MD5 will repeat once in each set of files of length modulus 16.
In reply to Re^3: Renaming an image file
by BrowserUk
in thread Renaming an image file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |