import pickle
import base64


def dumps(mydict):
    """
    将字典转换成加密字符串
    :param mydict:
    :return:
    """
    # 将字典转字节b'\x**\x**..'
    bytes_hex = pickle.dumps(mydict)
    #加密b'a-zA-Z0-9='
    bytes_64 = base64.b64encode(bytes_hex)
    # 转字符串
    return bytes_64.decode()