public class SimpleCryptUtils extends Object
构造说明 :
md5 以及 hash
| 构造器和说明 |
|---|
SimpleCryptUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
generateSalt(int numBytes)
生成随机的Byte[]作为salt.
|
static byte[] |
md5(InputStream input)
对文件进行md5散列.
|
static byte[] |
sha1(byte[] input)
对输入字符串进行sha1散列.
|
static byte[] |
sha1(byte[] input,
byte[] salt)
对输入字符串进行sha1散列.
|
static byte[] |
sha1(byte[] input,
byte[] salt,
int iterations)
对输入字符串进行sha1散列.
|
static byte[] |
sha1(InputStream input)
对文件进行sha1散列.
|
public static byte[] sha1(byte[] input)
input - 字符串字节public static byte[] sha1(byte[] input,
byte[] salt)
input - 字符串字节salt - 加密盐public static byte[] sha1(byte[] input,
byte[] salt,
int iterations)
input - 字符串字节salt - 加密盐iterations - 迭代计算次数public static byte[] generateSalt(int numBytes)
numBytes - byte数组的大小public static byte[] md5(InputStream input) throws IOException
input - 输入流IOException - 异常抛出public static byte[] sha1(InputStream input) throws IOException
input - 输入流IOException - 异常抛出Copyright © 2019. All rights reserved.