Name: Anonymous 2009-09-14 3:51
I've got a problem. I been using MD5 hash as the name for images, but it's too damn long. What would you guys suggest as a shorter alternative solution?
<?php
$file = file_get_contents("image.jpg");
$hash = 0;
for ($i = 0; $i < strlen($file); $i++) {
$character = ord($file{$i});
$hash = ($hash + $character) % 256;
}
$hash = ord($hash);
?>