Class EncryptUtils

java.lang.Object
com.luna.common.encrypt.EncryptUtils

public class EncryptUtils extends Object
Author:
luna@mac 2021年05月10日 14:27
  • Constructor Details

    • EncryptUtils

      public EncryptUtils()
  • Method Details

    • md5Checksum

      public static String md5Checksum(String md5Prefix, String md5Postfix, String toDigest)
      根据内容生成一串校验和
      Parameters:
      md5Prefix - 指定前缀
      md5Postfix - 指定后缀
      toDigest - 原内容
      Returns:
      校验和
      Throws:
      Exception
    • dataEncryptByJdk

      public static String dataEncryptByJdk(String input, String hashType)
      获得一个字符串的encrypt值
      Parameters:
      input - 输入的字符串
      Returns:
      输入字符串的MD5值
    • fileEncryptByJdk

      public static String fileEncryptByJdk(String path, String hashType)
      JDK 获取文件唯一值
      Parameters:
      path - 文件路径
      hashType - 密文类型
      Returns:
    • streamEncryptByJdk

      public static String streamEncryptByJdk(InputStream in, String hashType)
      JDK Md5输入流
      Parameters:
      in -
      hashType -
      Returns:
    • byteArrayToHex

      public static String byteArrayToHex(byte[] byteArray)
      字符数组组合成字符串返回
      Parameters:
      byteArray -
      Returns:
    • encryptByCommonIo

      public static String encryptByCommonIo(InputStream in, String hashType)
      Commons.io 获取md5值
      Parameters:
      in -
      Returns:
    • encryptByCommonIo

      public static String encryptByCommonIo(String data, String hashType)
      Commons.io 获取md5值
      Parameters:
      data -
      Returns: