/**
* 解密
*
* @param pwd
* @return
* @see [类、类#方法、类#成员]
*/
public static String decodeStr(String pwd)
{
Base64 base64 = new Base64();
byte[] debytes = base64.decodeBase64(new String(pwd).getBytes());
return new String(debytes);
}
/**
* 加密
*
* @param pwd
* @return
* @see [类、类#方法、类#成员]
*/
public static String encodeStr(String pwd)
{
Base64 base64 = new Base64();
byte[] enbytes = base64.encodeBase64Chunked(pwd.getBytes());
return new String(enbytes);
}
org.apache.commons.codec.binary.Base64 加密解密
最新推荐文章于 2024-06-13 13:32:22 发布