public static byte[] getUnsignedBytes(BigInteger number, int length) {
		byte[] value = number.toByteArray();

		if (value.length > length + 1) {
			throw new IllegalArgumentException(
					"The given BigInteger does not fit into a byte array with the given length: " + value.length
							+ " > " + length);
		}

		byte[] result = new byte[length];

		int i = value.length == length + 1 ? 1 : 0;
		for (; i < value.length; i++) {
			result[i + length - value.length] = value[i];
		}

		return result;
	}