def base64_decodestring(instr):
    if six.PY3:
        b = salt.utils.to_bytes(instr)
        data = base64.decodebytes(b)
        try:
            return salt.utils.to_str(data)
        except UnicodeDecodeError:
            return data
    return base64.decodestring(instr)
Decode a base64-encoded string using the "legacy" Python interface
dataset/ETHPy150Open saltstack/salt/salt/modules/hashutil.py/base64_decodestring