from typing import Union
import json


def dump_json(obj: Union[dict, list, str, int, float], **kwargs) -> bytes:
    """Dump dict to json encoded bytes string"""
    return json.dumps(obj, **kwargs).encode()