byte []digest = md.digest();  StringBuilder sb = new StringBuilder(); for (int i = 0; i < digest.length; i++) { int d1 = (digest[i] >> 4) & 0xf; int d2 = (digest[i] & 0xf);  sb.append(toHexChar(d1)); sb.append(toHexChar(d2)); }  return sb.toString();
  public static String md5(String source,                           @Optional boolean rawOutput)    throws Throwable  {    MessageDigest md = MessageDigest.getInstance("MD5");    // XXX: iso-8859-1    for (int i = 0; i < source.length(); i++) {      char ch = source.charAt(i);      md.update((byte) ch);    }    byte []digest = md.digest();    StringBuilder sb = new StringBuilder();    for (int i = 0; i < digest.length; i++) {      int d1 = (digest[i] >> 4) & 0xf;      int d2 = (digest[i] & 0xf);      sb.append(toHexChar(d1));      sb.append(toHexChar(d2));    }    return sb.toString();  }