Add hash function for digest.