mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix code
This commit is contained in:
parent
b5bc213a63
commit
6accf8fca0
@ -38,6 +38,7 @@ import java.security.MessageDigest;
|
|||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.security.Provider;
|
import java.security.Provider;
|
||||||
import java.security.Security;
|
import java.security.Security;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 安全相关工具类<br>
|
* 安全相关工具类<br>
|
||||||
@ -524,6 +525,9 @@ public class SecureUtil {
|
|||||||
* @since 4.3.3
|
* @since 4.3.3
|
||||||
*/
|
*/
|
||||||
public static byte[] decode(final String key) {
|
public static byte[] decode(final String key) {
|
||||||
|
if(Objects.isNull(key)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return Validator.isHex(key) ? HexUtil.decodeHex(key) : Base64.decode(key);
|
return Validator.isHex(key) ? HexUtil.decodeHex(key) : Base64.decode(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user