You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.5 KiB
59 lines
1.5 KiB
package com.fanruan.api.util; |
|
|
|
import com.fr.base.BaseUtils; |
|
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); |
|
} |
|
|
|
/** |
|
* 将对象转化成JSON字符串 |
|
* |
|
* @param obj 待处理的对象 |
|
* @return 字符串 |
|
*/ |
|
public static String jsonEncode(Object obj) { |
|
return BaseUtils.jsonEncode(obj); |
|
} |
|
}
|
|
|