code: public static String digest(String algorithm, String data, String enc) throws NoSuchAlgorithmException,
        UnsupportedEncodingException
     {
  
        return digest(algorithm, data.getBytes(enc));
     }
docs: Digest the plain string using the given algorithm.
  
  @param algorithm
  The alogrithm for the digest. This algorithm must be supported by the MessageDigest
  class.
  @param data
  The plain text String to be digested.
  @param enc
  The character encoding to use
  @return The digested plain text String represented as Hex digits.
  @throws java.security.NoSuchAlgorithmException
  if the desired algorithm is not supported by the MessageDigest class.
  @throws java.io.UnsupportedEncodingException
  if the encoding is not supported