import binascii


def bytes_str(val):
    """
    Converts bytes into hex string.

    Returns:
        hex string
    """
    assert isinstance(val, (bytes, bytearray))
    return binascii.hexlify(val).decode('ascii')