@@ -32,8 +32,7 @@ | |||
| 32 | 32 | import java.io.UnsupportedEncodingException; | |
| 33 | 33 | import java.security.MessageDigest; | |
| 34 | 34 | import java.security.NoSuchAlgorithmException; | |
| 35 | - | ||
| 36 | - import javax.xml.bind.DatatypeConverter; | ||
| 35 | + import java.util.Base64; | ||
| 37 | 36 | ||
| 38 | 37 | /** | |
| 39 | 38 | * Utility class for computing cryptographic hashes. | |
@@ -98,7 +97,7 @@ public static String hex(final byte[] bytes) { | |||
| 98 | 97 | ||
| 99 | 98 | /** Converts the given byte array to a base64 string. */ | |
| 100 | 99 | public static String base64(final byte[] bytes) { | |
| 101 | - return DatatypeConverter.printBase64Binary(bytes); | ||
| 100 | + return new String(Base64.getEncoder().encode(bytes)); | ||
| 102 | 101 | } | |
| 103 | 102 | ||
| 104 | 103 | /** | |
0 commit comments