Re: Hashing strings
| From: | Jason Barnett | Date: | Thu, 17 Feb 2005 23:26:45 +0000 |
| Subject: | Re: Hashing strings | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-208966@lists.php.net to get a copy of this message | ||
Gerard Samuel wrote:
...
>>> Im trying to determine if md5() would be the fastest,
>>> *cheapest* solution.
...
> What Im looking for is something where the generated hashes can
> be reproduced.
> For example, md5('foo') today, will be equal to md5('foo') tomorrow.
> Thanks
AFAIK crc32() is the fastest hashing function in PHP. I don't have
actual results on hand still, but I created a filesystem plugin that
auto-generates hashes for each file in a directory. crc32() was faster
than md5() and sha1().
FYI the benchmarking that I did was for a Windows XP system... YMMV
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc