Originally Posted by felgall
For me it outputted 1d6523e70706d7811e55ab15ba91f2432eeda1e8
since it is using a random value you'd expect it to return a different value each time - but each of these is 40 characters, not the 42 in the original post.
All I know is that I keep getting strings that are 42 characters long.
When I remove the variable $sessMemberID (or the hard-coded value of "19"), then I am getting a string that is 40 characters?!
I can't explain that behavior, so for now, I will assume and hope that...
$newBasename = sha1(uniqid(mt_rand(), FALSE));
// $newBasename = sha1($sessMemberID . uniqid(mt_rand(), FALSE));
$newFilename = $newBasename . $fileExt;
... is a sufficient fix to guarantee a unique, and fixed-width Photo Filename?