Package org.eclipse.jgit.util
Class Hex
- java.lang.Object
-
- org.eclipse.jgit.util.Hex
-
public final class Hex extends Object
Encodes and decodes to and from hexadecimal notation.- Since:
- 5.7
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
decode(String s)
Decode a hexadecimal string to a byte array.static String
toHexString(byte[] b)
Encode a byte array to a hexadecimal string.
-
-
-
Method Detail
-
decode
public static byte[] decode(String s)
Decode a hexadecimal string to a byte array. Note this method validates that characters in the given string are valid as digits in a hex string.- Parameters:
s
- hexadecimal string- Returns:
- decoded array
-
toHexString
public static String toHexString(byte[] b)
Encode a byte array to a hexadecimal string.- Parameters:
b
- byte array- Returns:
- hexadecimal string
-
-