public static byte[] hexStringToByteArray(String s) {
    String noSpaceString = s.replaceAll(" ", "");
    byte[] data = decodeHex(noSpaceString);
    return data;
  }
Quickly converts a hexadecimal string to a byte array.
fbcore/src/main/java/com/facebook/common/util/Hex.java