类 HashUtil
java.lang.Object
cn.vorbote.core.utils.HashUtil
HashUtil can help you hash arbitrary strings.
- 作者:
- vorbote
-
方法概要
修饰符和类型方法说明static Stringbase64Decode(String value) Decode the string via Base64.static Stringbase64Encode(String value) Encrypt the string via Base64.static StringThis method can decrypt a encrypted String(in byte mode).static StringThis method can decrypt an encrypted String(in byte mode).static StringEncrypt the string via specified encrypt method.static StringEncrypt a string to a HexStringstatic byte[]encryptToByteStream(Hash method, String data, String key) Encrypt the data through a key.
-
方法详细资料
-
encrypt
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
- 抛出:
UnsupportedHashAlgorithmException- If the param method used an item which is not listed on the list above, the exception will be thrown.- 另请参阅:
-
base64Encode
Encrypt the string via Base64.- 参数:
value- The string will be encrypted.- 返回:
- The encrypted String.
-
base64Decode
Decode the string via Base64.- 参数:
value- The string will be encrypted.- 返回:
- The encrypted String.
-
decrypt
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
This method can decrypt an encrypted String(in byte mode).- 参数:
method- The decrypt method type.key- The key to decrypt the String.data- The encryptedString.- 返回:
- The original string.
-
encryptToByteStream
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
Encrypt a string to a HexString- 参数:
method- The specified method.data- The origin data.key- The key.- 返回:
- The encrypted string.
-