Re: Hash/checksum for an image?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 5:16 PM -0800 1/15/07, Brian Dunning wrote:
I want to make sure that a jpg uploaded by the user is unique. I was thinking about storing a hash code for each image in its MySQL record (got a db record for each uploaded image already). Is there an easy way to generate such a string?

I do a similar thing on one of my projects and use an m5 hash to keep unique id's for every image. However, I don't specifically know of any way to make sure that the jpg the user is uploading indeed unique. The user may submit the same image more than once.

It's possible to look at the header and data of the image to detect uniqueness. In my Mac programming days I used to store image information inside the "not-used" portions of the header (lot's of room there), but I am clueless as to how to do that with php.

However, php is so robust I would be surprised if there's not a way to bit-twiddle a file -- does anyone have an example or can provide a reference?

Thanks,

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux