public class Digests extends Object
| 构造器和说明 |
|---|
Digests() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
generateSalt(int numBytes)
生成随机的Byte[]作为salt.
|
static String |
hash(String s) |
static byte[] |
md5(byte[] input)
对输入字符串进行md5散列.
|
static byte[] |
md5(byte[] input,
int iterations) |
static byte[] |
md5(InputStream input)
对文件进行md5散列.
|
static byte[] |
sha1(byte[] input)
对输入字符串进行sha1散列.
|
static byte[] |
sha1(byte[] input,
byte[] salt) |
static byte[] |
sha1(byte[] input,
byte[] salt,
int iterations) |
static byte[] |
sha1(InputStream input)
对文件进行sha1散列.
|
public static byte[] md5(byte[] input)
public static byte[] md5(byte[] input,
int iterations)
public static byte[] sha1(byte[] input)
public static byte[] sha1(byte[] input,
byte[] salt)
public static byte[] sha1(byte[] input,
byte[] salt,
int iterations)
public static byte[] generateSalt(int numBytes)
numBytes - byte数组的大小public static byte[] md5(InputStream input) throws IOException
IOExceptionpublic static byte[] sha1(InputStream input) throws IOException
IOExceptionCopyright © 2022. All rights reserved.