org.bouncycastle.util.encoders.Hex.encode()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(1374)

本文整理了Java中org.bouncycastle.util.encoders.Hex.encode()方法的一些代码示例,展示了Hex.encode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hex.encode()方法的具体详情如下:
包路径:org.bouncycastle.util.encoders.Hex
类名称:Hex
方法名:encode

Hex.encode介绍

[英]encode the input data producing a Hex encoded byte array.
[中]对输入数据进行编码,生成十六进制编码的字节数组。

代码示例

代码示例来源:origin: igniterealtime/Openfire

utf16leBytes = password.getBytes("UTF-16LE");
digestBytes = md.digest(utf16leBytes);
return new String(new String(Hex.encode(digestBytes)));

代码示例来源:origin: SeanDragon/protools

/**
 * SHA-1加密
 *
 * @param data
 *         待加密数据
 *
 * @return byte[] 消息摘要
 *
 * @throws Exception
 */
public static String encodeSHAHex(byte[] data) throws NoSuchAlgorithmException {
  // 执行消息摘要
  byte[] b = encodeSHA(data);
  // 做十六进制编码处理
  return new String(Hex.encode(b));
}

代码示例来源:origin: SeanDragon/protools

/**
 * MD5加密
 *
 * @param data
 *         待加密数据
 *
 * @return String 消息摘要
 *
 * @throws NoSuchAlgorithmException
 */
public static String encodeMD5Hex(byte[] data) throws NoSuchAlgorithmException {
  // 执行消息摘要
  byte[] b = encodeMD5(data);
  // 做十六进制编码处理
  return new String(Hex.encode(b));
}

代码示例来源:origin: SeanDragon/protools

/**
 * SHA-256加密
 *
 * @param data
 *         待加密数据
 *
 * @return byte[] 消息摘要
 *
 * @throws Exception
 */
public static String encodeSHA256Hex(byte[] data) throws NoSuchAlgorithmException {
  // 执行消息摘要
  byte[] b = encodeSHA256(data);
  // 做十六进制编码处理
  return new String(Hex.encode(b));
}

代码示例来源:origin: SeanDragon/protools

/**
 * MD2加密
 *
 * @param data
 *         待加密数据
 *
 * @return byte[] 消息摘要
 *
 * @throws Exception
 */
public static String encodeMD2Hex(byte[] data) throws NoSuchAlgorithmException {
  // 执行消息摘要
  byte[] b = encodeMD2(data);
  // 做十六进制编码处理
  return new String(Hex.encode(b));
}

代码示例来源:origin: SeanDragon/protools

/**
 * RipeMD320Hex消息摘要
 *
 * @param data
 *         待做消息摘要处理的数据
 *
 * @return byte[] 消息摘要
 *
 * @throws Exception
 */
public static String encodeRipeMD320Hex(byte[] data) throws NoSuchAlgorithmException {
  // 执行消息摘要
  byte[] b = encodeRipeMD320(data);
  // 做十六进制编码处理
  return new String(Hex.encode(b));
}

代码示例来源:origin: SeanDragon/protools

/**
 * SHA-224加密
 *
 * @param data
 *         待加密数据
 *
 * @return byte[] 消息摘要
 *
 * @throws Exception
 */
public static String encodeSHA224Hex(byte[] data) throws NoSuchAlgorithmException {
  // 执行消息摘要
  byte[] b = encodeSHA224(data);
  // 做十六进制编码处理
  return new String(Hex.encode(b));
}

代码示例来源:origin: SeanDragon/protools

/**
 * RipeMD128Hex消息摘要
 *
 * @param data
 *         待做消息摘要处理的数据
 *
 * @return byte[] 消息摘要
 *
 * @throws Exception
 */
public static String encodeRipeMD128Hex(byte[] data) throws NoSuchAlgorithmException {
  // 执行消息摘要
  byte[] b = encodeRipeMD128(data);
  // 做十六进制编码处理
  return new String(Hex.encode(b));
}

代码示例来源:origin: SeanDragon/protools

/**
 * RipeMD256Hex消息摘要
 *
 * @param data
 *         待做消息摘要处理的数据
 *
 * @return byte[] 消息摘要
 *
 * @throws Exception
 */
public static String encodeRipeMD256Hex(byte[] data) throws NoSuchAlgorithmException {
  // 执行消息摘要
  byte[] b = encodeRipeMD256(data);
  // 做十六进制编码处理
  return new String(Hex.encode(b));
}

代码示例来源:origin: SeanDragon/protools

/**
 * SHA-384加密
 *
 * @param data
 *         待加密数据
 *
 * @return byte[] 消息摘要
 *
 * @throws Exception
 */
public static String encodeSHA384Hex(byte[] data) throws NoSuchAlgorithmException {
  // 执行消息摘要
  byte[] b = encodeSHA384(data);
  // 做十六进制编码处理
  return new String(Hex.encode(b));
}

代码示例来源:origin: SeanDragon/protools

/**
 * TigerHex加密
 *
 * @param data
 *         待加密数据
 *
 * @return byte[] 消息摘要
 *
 * @throws Exception
 */
public static String encodeTigerHex(byte[] data) throws NoSuchAlgorithmException {
  // 执行消息摘要
  byte[] b = encodeTiger(data);
  // 做十六进制编码处理
  return new String(Hex.encode(b));
}

代码示例来源:origin: SeanDragon/protools

/**
 * SHA-512加密
 *
 * @param data
 *         待加密数据
 *
 * @return byte[] 消息摘要
 *
 * @throws Exception
 */
public static String encodeSHA512Hex(byte[] data) throws NoSuchAlgorithmException {
  // 执行消息摘要
  byte[] b = encodeSHA512(data);
  // 做十六进制编码处理
  return new String(Hex.encode(b));
}

代码示例来源:origin: SeanDragon/protools

/**
 * WhirlpoolHex加密
 *
 * @param data
 *         待加密数据
 *
 * @return byte[] 消息摘要
 *
 * @throws Exception
 */
public static String encodeWhirlpoolHex(byte[] data) throws NoSuchAlgorithmException {
  // 执行消息摘要
  byte[] b = encodeWhirlpool(data);
  // 做十六进制编码处理
  return new String(Hex.encode(b));
}

代码示例来源:origin: SeanDragon/protools

/**
 * GOST3411Hex加密
 *
 * @param data
 *         待加密数据
 *
 * @return byte[] 消息摘要
 *
 * @throws Exception
 */
public static String encodeGOST3411Hex(byte[] data) throws NoSuchAlgorithmException {
  // 执行消息摘要
  byte[] b = encodeGOST3411(data);
  // 做十六进制编码处理
  return new String(Hex.encode(b));
}

代码示例来源:origin: SeanDragon/protools

/**
 * MD4加密
 *
 * @param data
 *         待加密数据
 *
 * @return String 消息摘要
 *
 * @throws Exception
 */
public static String encodeMD4Hex(byte[] data) throws NoSuchAlgorithmException {
  // 执行消息摘要
  byte[] b = encodeMD4(data);
  // 做十六进制编码处理
  return new String(Hex.encode(b));
}

代码示例来源:origin: SeanDragon/protools

/**
 * RipeMD160Hex消息摘要
 *
 * @param data
 *         待做消息摘要处理的数据
 *
 * @return byte[] 消息摘要
 *
 * @throws Exception
 */
public static String encodeRipeMD160Hex(byte[] data) throws NoSuchAlgorithmException {
  // 执行消息摘要
  byte[] b = encodeRipeMD160(data);
  // 做十六进制编码处理
  return new String(Hex.encode(b));
}

代码示例来源:origin: SeanDragon/protools

/**
 * HmacRipeMD160Hex消息摘要
 *
 * @param data
 *         待做消息摘要处理的数据
 * @param key
 *         密钥
 *
 * @return String 消息摘要
 *
 * @throws Exception
 */
public static String encodeHmacRipeMD160Hex(byte[] data, byte[] key) throws InvalidKeyException, NoSuchAlgorithmException {
  // 执行消息摘要
  byte[] b = encodeHmacRipeMD160(data, key);
  // 做十六进制转换
  return new String(Hex.encode(b));
}

代码示例来源:origin: SeanDragon/protools

/**
 * HmacMD4Hex消息摘要
 *
 * @param data
 *         待做消息摘要处理的数据
 * @param key
 *         密钥
 *
 * @return String 消息摘要
 *
 * @throws Exception
 */
public static String encodeHmacMD4Hex(byte[] data, byte[] key) throws InvalidKeyException, NoSuchAlgorithmException {
  // 执行消息摘要
  byte[] b = encodeHmacMD4(data, key);
  // 做十六进制转换
  return new String(Hex.encode(b));
}

代码示例来源:origin: SeanDragon/protools

/**
 * HmacSHA224Hex消息摘要
 *
 * @param data
 *         待做消息摘要处理的数据
 * @param key
 *         密钥
 *
 * @return String 消息摘要
 *
 * @throws Exception
 */
public static String encodeHmacSHA224Hex(byte[] data, byte[] key) throws InvalidKeyException, NoSuchAlgorithmException {
  // 执行消息摘要
  byte[] b = encodeHmacSHA224(data, key);
  // 做十六进制转换
  return new String(Hex.encode(b));
}

代码示例来源:origin: SeanDragon/protools

/**
 * HmacRipeMD128Hex消息摘要
 *
 * @param data
 *         待做消息摘要处理的数据
 * @param key
 *         密钥
 *
 * @return byte[] 消息摘要
 *
 * @throws Exception
 */
public static String encodeHmacRipeMD128Hex(byte[] data, byte[] key) throws InvalidKeyException, NoSuchAlgorithmException {
  // 执行消息摘要
  byte[] b = encodeHmacRipeMD128(data, key);
  // 做十六进制转换
  return new String(Hex.encode(b));
}

相关文章

微信公众号

最新文章

更多