Page 1 of 1

Hash examples correctness

Posted: Fri Jan 27, 2017 4:47 pm
by Sebaall
Hi.
I'm working on iOS app in Swift for downloading subtitles from OS. I implemented hashing algorithm basing on Swift 3 example. I tested it with 'breakdance.avi' file and got correct hash, i.e. 8e245d9679d31e12, but after testing it with 'dummy.rar' I got 2a527d74d45f5b1b instead of 61f7751fc2a72bfb as Hash algorithm documentation suggests. After not being able to find error in my code I checked Swift 3 implementation from documentation along with C++, Java and Ruby implementations. All of them gave me the same result as my implementation, which poses a question - are all implementations in documentation wrong or is it the hash for dummy.rar which is wrong?

Re: Hash examples correctness

Posted: Fri Jan 27, 2017 6:44 pm
by sarathkcm
I think you need to extract dummy.rar and calculate the hash for its content.

Re: Hash examples correctness

Posted: Fri Jan 27, 2017 6:51 pm
by Sebaall
I feel so stupid now. I read "unpacked" in documentation couple of times and tried with packed file. Somehow I confused this word's meaning with 'archived'. In my defense, English is not my first language. Thank you for your help!