diff options
Diffstat (limited to 'security-utils/src/main/java')
-rw-r--r-- | security-utils/src/main/java/com/yahoo/security/ArrayUtils.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/security-utils/src/main/java/com/yahoo/security/ArrayUtils.java b/security-utils/src/main/java/com/yahoo/security/ArrayUtils.java index 41f19d5c82c..476b2e27048 100644 --- a/security-utils/src/main/java/com/yahoo/security/ArrayUtils.java +++ b/security-utils/src/main/java/com/yahoo/security/ArrayUtils.java @@ -1,9 +1,8 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.security; -import org.bouncycastle.util.encoders.Hex; - import java.nio.charset.StandardCharsets; +import java.util.HexFormat; /** * A small collection of utils for working on arrays of bytes. @@ -32,11 +31,11 @@ public class ArrayUtils { } public static byte[] unhex(String hexStr) { - return Hex.decode(hexStr); + return HexFormat.of().parseHex(hexStr); } public static String hex(byte[] bytes) { - return Hex.toHexString(bytes); + return HexFormat.of().formatHex(bytes); } public static byte[] toUtf8Bytes(String str) { |