| | |
| | | */ |
| | | public static String decryptData(String data,String aesKey,String encoding) { |
| | | try{ |
| | | if(data == null){ |
| | | return null; |
| | | } |
| | | if(StringUtils.isEmpty(encoding)){ |
| | | encoding = "UTF-8"; |
| | | } |
| | |
| | | */ |
| | | public static String encryptData(String data,String aesKey,String encoding) { |
| | | try { |
| | | if(data == null){ |
| | | return null; |
| | | } |
| | | if (StringUtils.isEmpty(encoding)) { |
| | | encoding = "UTF-8"; |
| | | } |
| | |
| | | * @return true or false |
| | | */ |
| | | public static boolean isHexStrValid(String str) { |
| | | if(str == null){ |
| | | return false; |
| | | } |
| | | String pattern = "^[0-9A-F]+$"; |
| | | return Pattern.compile(pattern).matcher(str).matches(); |
| | | } |