Package org.eclipse.jgit.util
Class Hex
java.lang.Object
org.eclipse.jgit.util.Hex
Encodes and decodes to and from hexadecimal notation.
- Since:
- 5.7
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
Decode a hexadecimal string to a byte array.static String
toHexString
(byte[] b) Encode a byte array to a hexadecimal string.
-
Field Details
-
HEX
private static final char[] HEX
-
-
Constructor Details
-
Hex
private Hex()Defeats instantiation.
-
-
Method Details
-
decode
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
Encode a byte array to a hexadecimal string.- Parameters:
b
- byte array- Returns:
- hexadecimal string
-