public class Digests extends Object
| 构造器和说明 |
|---|
Digests() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
generateSalt(int numBytes)
生成随机的 byte[] 作为salt.
|
static byte[] |
md5(byte[] input)
对输入字符串进行md5散列.
|
static byte[] |
md5(byte[] input,
int iterations)
对输入字符串进行md5散列.
|
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[] md5(byte[] input)
input - 字符串数据public static byte[] md5(byte[] input,
int iterations)
input - 字符串数据iterations - 迭代次数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[] md5(InputStream input)
input - 文件数据public static byte[] sha1(InputStream input)
input - 文件数据public static byte[] generateSalt(int numBytes)
numBytes - byte 数组的大小Copyright © 2022. All rights reserved.