Ticket #1936 (closed bug: fixed)
SHA256 sums don't seem to match with external tools.
Reported by: | DavidCzech | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 3.0 |
Component: | library | Version: | master |
Severity: | medium | Keywords: | gci |
Cc: | Language: | ||
Patch status: | Platform: | all |
Description
Not sure if the SHA256 implementation is broken, or if I'm doing it wrong, but they don't seem to match up with my system's sha256sum tool, nor other external services to generate sha265 hashes.
Attached are a simple example in PIR which should output the sha256 of "blah" (8b7df143d91c716ecfa5fc1730022f6b421b05cedee8fd52b1fc65a96030ad52 according to various sources, shown below), and an file containing "blah" to use sha256sum on. The test program doesn't output the right hash:
david@animal:~/Data/GCI/kapace-parrot$ ./parrot test_sha.pir 61a19cfc37762ce0c099bf37d86159501986a1ff3ea31e8c29412a29d0e4181cdavid@animal:~/Data/GCI/kapace-parrot$
Online calculators and sources for checking: http://www.xorbin.com/tools/sha256-hash-calculator (type in "blah")
- 8b7df143d91c716ecfa5fc1730022f6b421b05cedee8fd52b1fc65a96030ad52
http://www.fileformat.info/tool/hash.htm?text=blah
- 8b7df143d91c716ecfa5fc1730022f6b421b05cedee8fd52b1fc65a96030ad52
And here is a test using my system's sha256sum tool on the sample file.
david@animal:~$ cat asdf # No newline at the end... blahdavid@animal:~$ sha256sum asdf 8b7df143d91c716ecfa5fc1730022f6b421b05cedee8fd52b1fc65a96030ad52 asdf david@animal:~$