public static String hashMD5(String str){
  return hashMD5(str.getBytes());
}

public static String hashMD5 ( String str ) { return hashMD5 ( str . getBytes ( ) ) ; }
returns the md5 hash of a string .
