protected static byte[] makeBin(String str, int len) throws UUIDException {
		/*
		 * Insure that an input string is either binary or hexadecimal. Returns
		 * binary representation, or false on failure.
		 */
		byte[] bytes = null;

		if (str.length() == len) {
			try {
				bytes = str.getBytes("ISO-8859-1");
			} catch (UnsupportedEncodingException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			if (bytes.length != len)
				throw new UUIDException("Input contains invalid characters");
		} else {
			str = str.replaceAll("urn:uuid:", ""); // strip URN scheme and
													// namespace
			str = str.replaceAll("[^a-f0-9]", ""); // strip non-hex characters
			if (str.length() == len * 2) {
				bytes = new byte[len];
				for (int i = 0; i < len * 2; i += 2) {
					bytes[i / 2] = (byte) ((Character.digit(str.charAt(i), 16) << 4) + Character
							.digit(str.charAt(i + 1), 16));
				}
			}
		}
		return bytes;
	}