Cache SHA1 digest result?

Posted by johnathan on Stack Overflow See other posts from Stack Overflow or by johnathan
Published on 2010-03-31T03:11:15Z Indexed on 2010/03/31 3:13 UTC
Read the original article Hit count: 410

Filed under:
|
|

I'm storing several versions of a file based on a digest of the original filename and its version, like this:

$filename = sha1($original . ':' . $version);

Would it be worth it to cache the digest ($filename) in memcache as a key/value pair (the key being the original + version and value the sha1 hash), or is generating the digest quick enough (for a high traffic php web app)?

Thanks,

Johnathan

© Stack Overflow or respective owner

Related posts about digest

Related posts about hashing