public static String hashKeyForDisk(String key){
  String cacheKey;
  try {
    final MessageDigest mDigest=MessageDigest.getInstance("MD5");
    mDigest.update(key.getBytes());
    cacheKey=bytesToHexString(mDigest.digest());
  }
 catch (  NoSuchAlgorithmException e) {
    cacheKey=String.valueOf(key.hashCode());
  }
  return cacheKey;
}

public static String hashKeyForDisk ( String key ) { String cacheKey ; try { final MessageDigest mDigest = MessageDigest . getInstance ( "MD5" ) ; mDigest . update ( key . getBytes ( ) ) ; cacheKey = bytesToHexString ( mDigest . digest ( ) ) ; } catch ( NoSuchAlgorithmException e ) { cacheKey = String . valueOf ( key . hashCode ( ) ) ; } return cacheKey ; }
a hashing method that changes a string ( like a url ) into a hash suitable for using as a disk filename .
