static byte[] hexToBytes(S s) { int n = l(s) / 2; byte[] bytes = new byte[n]; for (int i = 0; i < n; i++) { S hex = substring(s, i*2, i*2+2); try { bytes[i] = (byte) parseHexByte(hex); } catch { fail("Bad hex byte: " + quote(hex) + " at " + i*2 + "/" + l(s)); } } ret bytes; }