The implementation hexToBytes accepts non-hex characters and does math on their values as if they are hex chars. For example,ABCD__ and ABCDEF turn into the same bytes. (Character.digit uses a return value of -1 as an error code.)
(EDIT: I had previously thought it didn't fail for an odd number of characters, but it actually does. However, an explicit check would be safer.)
The implementation hexToBytes accepts non-hex characters and does math on their values as if they are hex chars. For example,
ABCD__
andABCDEF
turn into the same bytes. (Character.digit
uses a return value of -1 as an error code.)(EDIT: I had previously thought it didn't fail for an odd number of characters, but it actually does. However, an explicit check would be safer.)