Class Md5Utils


  • public final class Md5Utils
    extends Object
    Utility methods for computing MD5 sums.
    • Method Detail

      • computeMD5Hash

        public static byte[] computeMD5Hash​(InputStream is)
                                     throws IOException
        Computes the MD5 hash of the data in the given input stream and returns it as an array of bytes. Note this method closes the given input stream upon completion.
        Throws:
        IOException
      • md5AsBase64

        public static String md5AsBase64​(InputStream is)
                                  throws IOException
        Returns the MD5 in base64 for the data from the given input stream. Note this method closes the given input stream upon completion.
        Throws:
        IOException
      • computeMD5Hash

        public static byte[] computeMD5Hash​(byte[] input)
        Computes the MD5 hash of the given data and returns it as an array of bytes.
      • md5AsBase64

        public static String md5AsBase64​(byte[] input)
        Returns the MD5 in base64 for the given byte array.