Class DigesterUtils

java.lang.Object
org.apache.maven.index.packer.DigesterUtils

public class DigesterUtils extends Object
A util class to calculate various digests on Strings. Useful for some simple password management.
Author:
cstamas
  • Constructor Details

    • DigesterUtils

      public DigesterUtils()
  • Method Details

    • getSha1Digest

      public static String getSha1Digest(String content)
      Calculates a SHA1 digest for a string.
      Parameters:
      content -
      Returns:
    • getSha1Digest

      public static String getSha1Digest(InputStream is)
      Calculates a SHA1 digest for a stream.
      Parameters:
      is -
      Returns:
    • getSha1Digest

      public static String getSha1Digest(File file) throws IOException
      Calculates a SHA1 digest for a file.
      Parameters:
      file -
      Returns:
      Throws:
      IOException
    • getMd5Digest

      public static String getMd5Digest(String content)
      Calculates a SHA1 digest for a string.
      Parameters:
      content -
      Returns:
    • getMd5Digest

      public static String getMd5Digest(InputStream is)
      Calculates a SHA1 digest for a stream.
      Parameters:
      is -
      Returns:
    • getMd5Digest

      public static String getMd5Digest(File file) throws IOException
      Calculates a SHA1 digest for a file.
      Parameters:
      file -
      Returns:
      Throws:
      IOException
    • encodeHex

      public static char[] encodeHex(byte[] data)
      Blatantly copied from commons-codec version 1.3
      Parameters:
      data -
      Returns: