import binascii


def int_to_bytes(i: int):
    """
    Convert an integer to a byte(s)
    Args:
        i: Integer to convert
    Returns:
        bytes
    """
    width = i.bit_length()
    width += 8 - ((width % 8) or 8)
    fmt = '%%0%dx' % (width // 4)
    return b"\x00" if i == 0 else binascii.unhexlify(fmt % i)