protected String hash ( String key ) throws VictimsException { try { MessageDigest mda = MessageDigest . getInstance ( MessageDigestAlgorithms . SHA_256 ) ; return Hex . encodeHexString ( mda . digest ( key . getBytes ( ) ) ) ; } catch ( NoSuchAlgorithmException e ) { throw new VictimsException ( String . format ( "Could not hash key: %s" , key ) , e ) ; } }
The hashing function used by the Cache .