类 HashUtil
- java.lang.Object
-
- cn.vorbote.commons.HashUtil
-
public final class HashUtil extends Object
This tool class can convert String to different types of results.- 作者:
- TheodoreHills
-
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static StringBase64Decode(String value)Decode the string via Base64static StringBase64Encode(String value)Encrypt the string via Base64static StringDecrypt(EncryptMethod method, String key, byte[] data)This method can decrypt a encrypted String(in byte mode).static StringDecrypt(EncryptMethod method, String key, String data)This method can decrypt a encrypted String(in byte mode).static StringEncrypt(EncryptMethod method, String value)Encrypt the string via specified encrypt method.static StringEncrypt(EncryptMethod method, String data, String key)Encrypt a string to a HexStringstatic byte[]EncryptToByteStream(EncryptMethod method, String data, String key)Encrypt the data through a key.
-
-
-
方法详细资料
-
Encrypt
public static String Encrypt(EncryptMethod method, String value)
Encrypt the string via specified encrypt method. All supported method:MD2MD5SHA-1SHA-224SHA-384SHA-512
- 参数:
method- Encrypt method.value- The string will be encrypted- 返回:
- The encrypted String
-
Base64Encode
public static String Base64Encode(String value)
Encrypt the string via Base64- 参数:
value- The string will be encrypted- 返回:
- The encrypted String
-
Base64Decode
public static String Base64Decode(String value)
Decode the string via Base64- 参数:
value- The string will be encrypted- 返回:
- The encrypted String
-
Decrypt
public static String Decrypt(EncryptMethod method, String key, byte[] data)
This method can decrypt a encrypted String(in byte mode).- 参数:
method- The decrypt method type.key- The key to decrypt the String.data- The encryptedString.- 返回:
- The original string.
- 另请参阅:
Decrypt(EncryptMethod, String, String)
-
Decrypt
public static String Decrypt(EncryptMethod method, String key, String data)
This method can decrypt a encrypted String(in byte mode).- 参数:
method- The decrypt method type.key- The key to decrypt the String.data- The encryptedString.- 返回:
- The original string.
-
EncryptToByteStream
public static byte[] EncryptToByteStream(EncryptMethod method, String data, String key)
Encrypt the data through a key.- 参数:
method- The method to encrypt the data.data- The data will be encrypt to rc4 string.key- The key to encrypt the string.- 返回:
- The encrypted String by stream.
-
Encrypt
public static String Encrypt(EncryptMethod method, String data, String key)
Encrypt a string to a HexString- 参数:
method- The specified method.data- The origin data.key- The key.- 返回:
- The encrypted string.
-
-