protected String hash(String key){
  try {
    MessageDigest gen=HASH_GENERATOR.get();
    byte[] keyBytes=key.getBytes("UTF-8");
    gen.update(keyBytes,0,keyBytes.length);
    byte[] binaryhash=gen.digest();
    return ENCODER.encodeToString(binaryhash);
  }
 catch (  Exception e) {
    LOG.warn("Failed to get hash encoding for key: {}",key,e);
  }
  return null;
}

protected String hash ( String key ) { try { MessageDigest gen = HASH_GENERATOR . get ( ) ; byte [ ] keyBytes = key . getBytes ( "UTF-8" ) ; gen . update ( keyBytes , 0 , keyBytes . length ) ; byte [ ] binaryhash = gen . digest ( ) ; return ENCODER . encodeToString ( binaryhash ) ; } catch ( Exception e ) { LOG . warn ( "Failed to get hash encoding for key: {}" , key , e ) ; } return null ; }
get the hash encoding of a key string .
