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第三方库


热门话题
java如何在jetty请求日志中添加milliscond字段?   java在使用Scanner类从文件读取信息时遇到问题   为什么。类不适用于泛型类型?   SQLite插入上的java空指针异常   java能告诉我们Guava缓存是在禁用统计数据的情况下构建的吗?   java在应用程序中使用常量   java无法使用AutoIT和Selenium Webdriver在所需位置/文件夹保存图像   java如何在jtable中更新jprogress栏   java是比较给定日期和当前日期(在给定时区中没有时间段)的最佳方法   安卓代码中的java错误   java无法访问实体类中的字段   java如何在tomcat中处理三个JDBC连接池?   java无法使用Spring Security保护AngularJS页面   如何在没有TCP/IP协议栈的情况下用Java发送以太帧