类 HashUtil
java.lang.Object
cn.vonce.sql.uitls.HashUtil
Utility class for hashing.
- 作者:
- liaoxuefeng
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static byte[]hmacSha1(byte[] data, byte[] key) Do HMAC-SHA1.static StringhmacSha256(byte[] data, byte[] key) Do HMAC-SHA256.static StringhmacSha256(byte[] data, String key) Do HMAC-SHA256.static StringhmacSha256(String data, String key) Do HMAC-SHA256.static byte[]hmacSha256AsBytes(byte[] data, byte[] key) Do HMAC-SHA256.static byte[]hmacSha256AsBytes(String data, String key) Do HMAC-SHA256.static Stringsha1(byte[] input) Generate SHA-1 as hex string (all lower-case).static StringGenerate SHA-1 as hex string (all lower-case).static byte[]sha1AsBytes(byte[] input) Generate SHA-1 as bytes.static byte[]sha1AsBytes(String input) static Stringsha256(byte[] input) Generate SHA-256 as hex string (all lower-case).static StringGenerate SHA-256 as hex string (all lower-case).static byte[]sha256AsBytes(byte[] input) Generate SHA-256 as bytes.static byte[]sha256AsBytes(String input) Generate SHA-256 as hex string (all lower-case).static byte[]sha512AsBytes(byte[] input) Generate SHA-512 as bytes.
-
构造器详细资料
-
HashUtil
public HashUtil()
-
-
方法详细资料
-
sha1
Generate SHA-1 as hex string (all lower-case).- 参数:
input- Input as string.- 返回:
- Hex string.
-
sha1
Generate SHA-1 as hex string (all lower-case).- 参数:
input- Input as bytes.- 返回:
- Hex string.
-
sha1AsBytes
-
sha1AsBytes
public static byte[] sha1AsBytes(byte[] input) Generate SHA-1 as bytes.- 参数:
input- Input as bytes.- 返回:
- Bytes.
-
sha256
Generate SHA-256 as hex string (all lower-case).- 参数:
input- Input as String.- 返回:
- Hex string.
-
sha256AsBytes
Generate SHA-256 as hex string (all lower-case).- 参数:
input- Input as String.- 返回:
- Hex string.
-
sha256
Generate SHA-256 as hex string (all lower-case).- 参数:
input- Input as bytes.- 返回:
- Hex string.
-
sha256AsBytes
public static byte[] sha256AsBytes(byte[] input) Generate SHA-256 as bytes.- 参数:
input- Input as bytes.- 返回:
- SHA bytes.
-
sha512AsBytes
public static byte[] sha512AsBytes(byte[] input) Generate SHA-512 as bytes.- 参数:
input- Input as bytes.- 返回:
- SHA bytes.
-
hmacSha256AsBytes
public static byte[] hmacSha256AsBytes(byte[] data, byte[] key) Do HMAC-SHA256.- 返回:
- Hex string.
-
hmacSha256
Do HMAC-SHA256.- 返回:
- Hex string.
-
hmacSha1
public static byte[] hmacSha1(byte[] data, byte[] key) Do HMAC-SHA1.- 返回:
- byte[] as result.
-
hmacSha256
Do HMAC-SHA256.- 返回:
- byte[] as result.
-
hmacSha256AsBytes
Do HMAC-SHA256.- 返回:
- byte[] as result.
-
hmacSha256
Do HMAC-SHA256.- 返回:
- byte[] as result.
-