import base64


def png_to_src(png):
    """Convert a PNG string to a format that can be passed into a src.

    :rtype: str
    """
    return 'data:image/png;base64,' + base64.b64encode(png).decode()