- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试编写一个小的 python 脚本来散列一些单词。我正在使用 hashcat 来验证我的输出,但出了点问题,这应该是一个非常简单的过程。但我无法确定我做错了什么。只有我的输出的最后一个散列被正确散列。在示例文件中使用“123456”作为 5 行的测试时,我得到以下输出:
f447b20a7fcbf53a5d5be013ea0b15af
f447b20a7fcbf53a5d5be013ea0b15af
f447b20a7fcbf53a5d5be013ea0b15af
f447b20a7fcbf53a5d5be013ea0b15af
e10adc3949ba59abbe56e057f20f883e
谁能指出我方法的错误。将不胜感激。
import hashlib
my_file = open("sample.txt" , "r")
for line in my_file:
try:
hash_object = hashlib.md5(line)
print(hash_object.hexdigest())
except:
print "Error"
my_file.close()
最佳答案
前四行的哈希值不同,因为您在 MD5 哈希计算中包含了回车符。最后一行没有此回车符,因此返回不同的值。只需使用 strip()
删除回车符,您将获得所有五行的相同哈希值:
import hashlib
my_file = open("sample.txt" , "r")
for line in my_file:
try:
hash_object = hashlib.md5(line.strip())
print(hash_object.hexdigest())
except:
print "Error"
my_file.close()
这给出了输出:
e10adc3949ba59abbe56e057f20f883e
e10adc3949ba59abbe56e057f20f883e
e10adc3949ba59abbe56e057f20f883e
e10adc3949ba59abbe56e057f20f883e
e10adc3949ba59abbe56e057f20f883e
关于python - 简单的Python查询——MD5哈希,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33740020/
我想在 md-toolbar 中使用 mf-tabs,我使用 Sithdown 在 https://github.com/angular/material/issues/1076 中提供的解决方案 它
我是新手,我设法用服务提供的数据实现了我的 md-table。现在我正在尝试实现过滤器、排序和分页功能,但我认为我做错了什么。 这是我的组件: import { Component, OnInit,
我必须打开一个 md-dialog,其中包含一个带有两个选项卡的 md-tab-group。 md-dialog 可以从两个按钮打开,这两个按钮应该打开相应的选项卡。打开 md-dialog 的模板:
我正在尝试做这样的事情: {{item}}
我正在尝试使用 md-datepicker 遍历一个月的时间间隔,因此我创建了这个 codepen 示例以便更好地演示: http://codepen.io/anon/pen/ygBGOg 当单击“P
这是关于 Codepen 的例子. 我正在设置 md-row-height="30px" 然后计算 md-rowspan 使其等于元素数 + 1。(头部加一) {{ t
当我频繁切换 md-tabs 时,Md-tabs 切换正确但多个 md-tab-item 元素同时具有“md-active”类,所以我看不到选项卡的内容是事件的,因为它与其右侧选项卡的内容重叠。 据我
我想将操作放在同一数据行上,我有两个操作,为此我使用按钮和图标作为下面的代码。 {{item.codigo}} {{it
在我的对象列表中,我可以激活/非事件对象。因此,一个图标执行事件操作,另一个图标执行非事件操作,并且两者都在同一个 md-list 中。 This is what i'm tring to do 代码
如前所述 Angular-Material md-autocomplete's documentation : The md-autocomplete uses the the md-virtual-
我也在使用 Angular 1 和 Angular Material 。我想在 ng-repeat 中使用 md-subheader 和多个 md-virtual-repeat-container。您
我正在使用 Angular Material 。 当我创建自己的指令并将其添加到 md-tab-label 时,例如 Label 然后自定义指令也应用于一些“md-dummy-tab”。 但是
我在我的项目中使用 Angular Material 有一段时间了。在使用 md-select 时,我遇到了一个问题,即出现重复的 md-option 值错误。 我知道 md-options 采用唯一
我正在根据单选按钮选择设置自动完成验证 md-require-match = true/false。 默认验证是 md-require-match = true 这样用户应该从自动完成列表中选择一个项
这个问题在这里已经有了答案: Changing capitalization of filenames in Git (11 个答案) 关闭 3 年前。 我使用“readme.md”创建了我的存储库
Github有办法吗?在例如 README.md 中包含 md 文件? # Headline Text [include](File:load_another_md_file_here.md) 它不应
我正在使用 AngularJs 开发这个动态过滤系统,并试图找出如何将 color 和 size 选项转换为在两个下拉列表中(每个类别一个)。 我尝试了以下代码,该代码成功添加了下拉列表以及选择框中的
var app = angular.module('tabsDemo', ['ngMaterial']); app.controller('TabsController',tabsController
在 md-tab 指令内嵌套 md-select 和搜索输入时遇到问题。 有两个问题: 选择框展开后,必须向上滚动才能查看搜索输入 搜索输入实际上不接受任何文本 我做了一个codepen为了更好地说明
我正在尝试处理这个片段,其中自动完成功能嵌入在芯片中。但从自动完成中选择的项目不会转换为筹码。 自动完成的数据采用以下方式:{name:"John Doe", id:"1"} 哪里错了,请指教。 问候
我是一名优秀的程序员,十分优秀!