|
|
|
package com.fanruan.api.util;
|
|
|
|
|
|
|
|
import com.fr.stable.CodeUtils;
|
|
|
|
import com.fr.stable.CommonCodeUtils;
|
|
|
|
|
|
|
|
public class CodeKit {
|
|
|
|
/**
|
|
|
|
* 给字符串解密
|
|
|
|
* @param passwordText 待解密的字符串
|
|
|
|
* @return 解密后的字符串
|
|
|
|
*/
|
|
|
|
public static String passwordDecode(String passwordText) {
|
|
|
|
return CodeUtils.passwordDecode(passwordText);
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* 将普通的java字符串编码成javascript代码
|
|
|
|
* @param string4javascript 待编码的字符串
|
|
|
|
* @return 编码后的代码
|
|
|
|
* */
|
|
|
|
public static String javascriptEncode(String string4javascript) {
|
|
|
|
return CommonCodeUtils.javascriptEncode(string4javascript);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 将经过处理的中日韩文字符串解码成原先的中日韩文
|
|
|
|
* @param text 经过处理的中日韩文字
|
|
|
|
* @return 中日韩文字
|
|
|
|
* @throws Exception
|
|
|
|
*/
|
|
|
|
public static String cjkDecode(String text) throws Exception {
|
|
|
|
return CodeUtils.cjkDecode(text);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 将经过处理字符串解码成原先字符串
|
|
|
|
* @param text 经过处理的字符串
|
|
|
|
* @return 字符串
|
|
|
|
* @throws Exception
|
|
|
|
*/
|
|
|
|
public static String encodeURIComponent(String text) {
|
|
|
|
return CommonCodeUtils.encodeURIComponent(text);
|
|
|
|
}
|
|
|
|
}
|