def as_bytes(x: int) -> bytes:
    """ cast int into bytes

    Parameters
    ----------
    x: int
        an integer to be cast into bytes

    Returns
    -------
    b: bytes
    """
    return x.to_bytes(1, "little")