计算包含某些字节的二进制文件的哈希 [英] calculate hash of binary file containing certain bytes
问题描述
对于如何手动"计算由某些字节组成的文件的哈希值(sha256),我感到难以理解.
I'm having trouble understanding the principle/method, on how to "manually" calculate a file's hash (sha256) which consist of certain bytes.
举个例子:
我有一个由这些字节组成的二进制文件.
I have this binary file consisting of these bytes.
2C F2 BA A3 0E 26 5A 3B 2A 1F 01 4A 01 66 60 02
如何获取文件的以下(正确)哈希值? ea3cbd30dc6c18914d2cdafdd8bec0ff4ce5995c7b484cce3237900336abb574
How to get following (correct) hash of the file? ea3cbd30dc6c18914d2cdafdd8bec0ff4ce5995c7b484cce3237900336abb574
推荐答案
1. 将所有字节转换为ASCII.
1. Convert all bytes to ASCII.
2. 散列ASCII字符串,以从文件中获取正确的散列.
2. Hash ASCII string to get correct hash from the file.
不建议手动执行此操作,因为复制和粘贴,或其他因素很容易使您的ASCII字符串失真.因此,最好将其编写在程序中以计算所有内容.
Doing this manually is not recommended, since e.g. copy and paste, or other factors can easily distort your ASCII string. So optimally this is written within a program to calculate everything altogether.
这篇关于计算包含某些字节的二进制文件的哈希的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!