calculate hash of binary file containing certain bytes

醉酒当歌 提交于 2019-12-11 17:43:47

问题


I'm having trouble understanding the principle/method, on how to "manually" calculate a file's hash (sha256) which consist of certain bytes.

To put into an example:

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

How to get following (correct) hash of the file? ea3cbd30dc6c18914d2cdafdd8bec0ff4ce5995c7b484cce3237900336abb574


回答1:


1. Convert all bytes to ASCII.

2. Hash ASCII string to get correct hash from the file.

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.



来源:https://stackoverflow.com/questions/50928253/calculate-hash-of-binary-file-containing-certain-bytes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!