public static byte[] convertStringToBytes(String hexstr) {
		try {
			byte[] bytes = new byte[hexstr.length() / 2];
			for (int i = 0; i < hexstr.length(); i += 2) {
				String bs = hexstr.substring(i, i + 2);
				bytes[i / 2] = (byte) Integer.parseInt(bs, 16);
			}
			return bytes;
		}
		catch (Exception e) {
			// tried, but failed
		}
		return null;
	}
Converts an integer into a string.
For example, given an integer 0x41424344,
the returned string would be "ABCD".
@param value the integer value
@return the converted string
GPL/DMG/src/dmg/java/mobiledevices/dmg/ghidra/GStringUtilities.java