def int_to_bytes(number: int) -> bytes:
    """Convert an integer to a byte string

    Arguments:
        number: the integer to convert

    Returns:
        just as many bytes as needed to represent the integer as an octet string
    """

    if number:
        return number.to_bytes((number.bit_length() + 7) // 8, "big")

    else:
        return b"\0"