Class MD5Util

java.lang.Object
de.dlr.proseo.basewrap.MD5Util

public class MD5Util extends Object
Utility methods to efficiently calculate an MD5 hash string from a file
Author:
Dr. Thomas Bassler
  • Constructor Details

    • MD5Util

      public MD5Util()
  • Method Details

    • bytesToHex

      public static String bytesToHex(byte[] bytes)
      Generate a string of hex digits (upper-case) representing the given byte array
      Parameters:
      bytes - the byte array to convert
      Returns:
      a string with (upper-case) hex digits
    • md5Digest

      public static String md5Digest(File inputFile) throws IOException
      Create an (upper-case) MD5 hash string for the given file
      Parameters:
      inputFile - the file to digest
      Returns:
      an MD5 hash string
      Throws:
      IOException - if the given file cannot be read