models.py 文件源码

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

项目:TheHive4py 作者: CERT-BDF 项目源码 文件源码
def _prepare_file_data(self, file_path):
        with open(file_path, "rb") as file_artifact:
            filename = os.path.basename(file_path)
            mime = magic.Magic(mime=True).from_file(file_path)
            encoded_string = base64.b64encode(file_artifact.read())

        return "{};{};{}".format(filename, mime, encoded_string.decode())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号