Closed GoogleCodeExporter closed 9 years ago
Confirmed that the bug has to do with endianness. "breakdance.avi" hashing
works in Undertext on Intel. I managed to get the
code to generate the (faulty) hash "2e7a4746f2e59094" as well. A call to
#reverse needs to be added like this:
f.read(CHUNK_SIZE).reverse.unpack("Q*").each { |n| ... }
Even though the Ruby docs doesn't say so explicitly, I'm pretty sure the
Q-directive above always means little-endian byte
order.
Some resources:
* http://www.ruby-forum.com/topic/82241
* http://www.codeproject.com/KB/cpp/endianness.aspx
* http://beej.us/guide/bgnet/output/html/multipage/htonsman.html
Original comment by johanlu...@gmail.com
on 27 Apr 2010 at 11:52
Commited probable fix in r189. For details read the commit message and diff
with code comments. Tested on
my Intel and it generates both correct and faulty hashes. Faulty hashes are
produced by inverting result of
endianness check, like this:
BIG_ENDIAN = [1].pack("s") != [1].pack("n")
Fix needs to be verified by testing this on PPC. Please download
"Undertext-1.2.189-prerelease.dmg" on
http://code.google.com/p/undertext/downloads/list.
Original comment by johanlu...@gmail.com
on 28 Apr 2010 at 9:39
I'll add the file here instead.
Original comment by johanlu...@gmail.com
on 28 Apr 2010 at 9:42
Attachments:
Has been tested on PPC and it's working.
Original comment by johanlu...@gmail.com
on 28 Apr 2010 at 9:23
Original issue reported on code.google.com by
johanlu...@gmail.com
on 27 Apr 2010 at 4:19