MD5哈希(校验和)验证工具

MD5-Checksum-verifier的Python项目详细描述


它用于检查与来自Internet的哈希一起存储的文件

  • 使用pip install md5-checksum-verifier
  • 安装

功能:

fromhash-toolimportverifytoolverifytool.validHash('md5-hash-here')#this will return True when a hash is valid, and false if invalid (this just checks if it is in the format of an md5 hash)verifytool.genhash('filenamehere')#this will generate and return the hash of a fileverifytool.validate('hash','original file source via the internet')

示例使用:

fromhash-toolimportverifytooltry:localFile=verifytool.genhash('text.txt')#generates and stores the hashifverifytool.validHash(localFile)==True:try:ifverifytool.validate(localFile,'https://web.org/test-original.txt')==True:print("File has not been tampered with")except:print("Invalid hash - file may have been tampered with")else:print("Issue generating hash")except:print("Issue generating hash")

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Docker&SeleniumJava:无法在Docker容器上运行的chrome浏览器中上载图像/文件   在python中运行java命令   Java垃圾收集器异常行为   java java是否根据底层操作系统执行字节码级优化?   java是否可以休眠自定义查询返回映射而不是列表?   java Spring引导RabbitMQ接收器Jackson反序列化到POJO   apache flex在ActionScript3中创建对象相等“HashMap”作为java HashMap   java如何在Eclipse集成中切换JProfiler启动器   缓存JSP页面结果的java最佳实践?   java集成jaxb绑定文件,使用CXF生成基于WSDL的客户端   java为什么在上传操作结束之前,客户端没有检测到HttpServletResponse的PrintWriter内容?   java在接口内创建类和在类内创建接口有什么用   java向文件写入错误Android Studio   java合并多个RealmList并对结果列表排序?   谷歌API视觉java。lang.NoSuchMethodError   java如何使用逗号分别存储每个值,然后将它们存储到单独的数组中?