from typing import Union


def string_encode(value: Union[float, int, str]) -> bytes:
    """Encode a value.

    :param value: The value to encode.
    :return: The encoded value

    """
    return str(value).encode("utf-8")