类 Secrets

java.lang.Object
net.apexes.commons.lang.Secrets

public final class Secrets extends Object
作者:
HeDYn
  • 方法详细资料

    • md5

      public static byte[] md5(InputStream is) throws IOException, NoSuchAlgorithmException
      获取输入流中数据的MD5码
      参数:
      is - 输入流
      返回:
      返回输入流中数据的MD5码
      抛出:
      IOException
      NoSuchAlgorithmException
    • md5

      public static byte[] md5(byte[] bytes)
      获取字符数组的MD5码
      参数:
      bytes - 字符数组
      返回:
      返回给定字符数组的MD5码
    • md5

      public static byte[] md5(String text)
      获取字符串的MD5码
      参数:
      text - 字符串
      返回:
      返回给定字符串的MD5码
    • md5

      public static byte[] md5(String text, String charsetName)
      获取字符串的MD5码
      参数:
      text - 字符串
      charsetName - 字符串的编码方式
      返回:
      返回字符串的MD5码
    • md5

      public static byte[] md5(String text, Charset charset)
      获取字符串的MD5码
      参数:
      text - 字符串
      charset - 字符串的编码方式
      返回:
      返回字符串的MD5码
    • md5Base58String

      public static String md5Base58String(byte[] bytes)
      获取字符数组的Base58编码MD5码
      参数:
      bytes - 字符数组
      返回:
      返回字符数组的Base58编码MD5码
    • md5Base58String

      public static String md5Base58String(String text)
      获取字符串的Base58编码MD5码
      参数:
      text - 字符串
      返回:
      返回给定字符串的Base58编码MD5码
    • md5Base58String

      public static String md5Base58String(String text, String charsetName)
      获取字符串的Base58编码MD5码
      参数:
      text - 字符串
      charsetName - 字符串的编码方式
      返回:
      返回字符串的Base58编码MD5码
    • md5Base58String

      public static String md5Base58String(String text, Charset charset)
      获取字符串的Base58编码MD5码
      参数:
      text - 字符串
      charset - 字符串的编码方式
      返回:
      返回字符串的Base58编码MD5码
    • md5HexString

      public static String md5HexString(byte[] bytes)
      获取字符数组的Hex编码MD5码
      参数:
      bytes - 字符数组
      返回:
      返回字符数组的Hex编码MD5码(全为小写)
    • md5HexString

      public static String md5HexString(String text)
      获取字符串的Hex编码MD5码
      参数:
      text - 字符串
      返回:
      返回给定字符串的Hex编码MD5码(全为小写)
    • md5HexString

      public static String md5HexString(String text, String charsetName)
      获取字符串的Hex编码MD5码
      参数:
      text - 字符串
      charsetName - 字符串的编码方式
      返回:
      返回字符串的Hex编码MD5码(全为小写)
    • md5HexString

      public static String md5HexString(String text, Charset charset)
      获取字符串的Hex编码MD5码
      参数:
      text - 字符串
      charset - 字符串的编码方式
      返回:
      返回字符串的Hex编码MD5码(全为小写)
    • sha1

      public static byte[] sha1(byte[] bytes)
      获取字符数组的SHA1码
      参数:
      bytes - 字符数组
      返回:
      返回字符数组的SHA1码
    • sha1

      public static byte[] sha1(String text)
      获取字符串的SHA1码
      参数:
      text - 字符串
      返回:
      返回字符串的SHA1码
    • sha1

      public static byte[] sha1(String text, String charsetName)
      获取字符串的SHA1码
      参数:
      text - 字符串
      charsetName - 字符串的编码方式
      返回:
      返回字符串的SHA1码
    • sha1

      public static byte[] sha1(String text, Charset charset)
      获取字符串的SHA1码
      参数:
      text - 字符串
      charset - 字符串的编码方式
      返回:
      返回字符串的SHA1码
    • sha1HexString

      public static String sha1HexString(byte[] bytes)
      获取字符数组的Hex格式SHA1码
      参数:
      bytes - 字符数组
      返回:
      返回字符数组的Hex格式SHA1码
    • sha1HexString

      public static String sha1HexString(String text)
      获取字符串的Hex格式SHA1码
      参数:
      text - 字符串
      返回:
      返回字符串的Hex格式SHA1码
    • sha1HexString

      public static String sha1HexString(String text, String charsetName)
      获取字符串的Hex格式SHA1码
      参数:
      text - 字符串
      charsetName - 字符串的编码方式
      返回:
      返回字符串的Hex格式SHA1码
    • sha1HexString

      public static String sha1HexString(String text, Charset charset)
      获取字符串的Hex格式SHA1码
      参数:
      text - 字符串
      charset - 字符串的编码方式
      返回:
      返回字符串的Hex格式SHA1码
    • sha1Base58String

      public static String sha1Base58String(byte[] bytes)
      获取字符数组的Base58编码SHA1码
      参数:
      bytes - 字符数组
      返回:
      返回字符数组的Base58编码SHA1码
    • sha1Base58String

      public static String sha1Base58String(String text)
      获取字符串的Base58编码SHA1码
      参数:
      text - 字符串
      返回:
      返回字符串的Base58编码SHA1码
    • sha1Base58String

      public static String sha1Base58String(String text, String charsetName)
      获取字符串的Base58编码SHA1码
      参数:
      text - 字符串
      charsetName - 字符串的编码方式
      返回:
      返回字符串的Base58编码SHA1码
    • sha1Base58String

      public static String sha1Base58String(String text, Charset charset)
      获取字符串的Base58编码SHA1码
      参数:
      text - 字符串
      charset - 字符串的编码方式
      返回:
      返回字符串的Base58编码SHA1码
    • aesEncrypt

      public static byte[] aesEncrypt(byte[] content, byte[] key)
      AES加密
      参数:
      content - 要加密的内容
      key - 密钥
      返回:
      返回加密后的内容
    • aesDecrypt

      public static byte[] aesDecrypt(byte[] content, byte[] key)
      AES解密
      参数:
      content - 要解密的内容
      key - 密钥
      返回:
      返回解密后的内容
    • skip32Encrypt

      public static long skip32Encrypt(int value, String key)
      将value进行skip32加密
      参数:
      value - 要加密码的值
      key - 加密密钥
      返回:
      返回加密后的值
    • skip32Decrypt

      public static int skip32Decrypt(long value, String key)
      将使用skip32加密的值解密
      参数:
      value - 要解决的值
      key - 解密密钥
      返回:
      返回解密后的值