Use hexdigest for cache key.

To make the cache key small. Problems can arise if the cache key is too long.