__init__.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:QUANTAXIS 作者: yutiansut 项目源码 文件源码
def encrypt(self, source_obj):
        encrypter = self._cipher.encryptor()
        source = json.dumps(source_obj)
        source = source.encode(self._encoding)
        need_to_padding = 16 - (len(source) % 16)
        if need_to_padding > 0:
            source = source + b'\x00' * need_to_padding
        enc_data = encrypter.update(source) + encrypter.finalize()
        b64_enc_data = base64.encodebytes(enc_data)
        return urllib.parse.quote(b64_enc_data)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号