Page 1 of 1

Which version of xxHash is used in FFAStrans?

Posted: Mon Sep 02, 2019 2:22 pm
by ThomasM
Hi there,

I wonder which version of xxHash is used in FFAStrans. Is it 32 or 64 Bit? Has it an "Initial Number"?

I ask because a MAM-System wants to check our Hashes. The people at the MAM asked us, which version and Initial Number...

Thanks in advance,
tom

Re: Which version of xxHash is used in FFAStrans?

Posted: Mon Sep 02, 2019 8:50 pm
by admin
Hi Thomas,

I belive it's 0.6.2, using 32 bit version for consistency across 32/64 bit installations of FFAStrans.

"Initial Number"? I'm not quite sure what you mean by that but maybe it's 0.6.x

-steinar

Re: Which version of xxHash is used in FFAStrans?

Posted: Thu Sep 05, 2019 7:44 am
by ThomasM
Hey Steinar,

thanks for the reply. The question is, if there is an "initial value" which is a given start-value for calculating the hashes?

kind regards,
tom

Re: Which version of xxHash is used in FFAStrans?

Posted: Thu Sep 05, 2019 12:35 pm
by emcodem
Hey Thomas,
you can tell your guys they can read the source code of interest here:

https://github.com/Cyan4973/xxHash/blob/dev/xxhsum.c

FFastrans calls this commandline tool with only the filename to hash as a parameter, no other parameters.
As far as i understand from the code (whithout understanding it too much), the "initial value" that you are after is set to "0". As seen in line 263 of the above xxhsum.c file:

Code: Select all

#define XXHSUM64_DEFAULT_SEED 0                   /* Default seed for algo_xxh64 */
You can play with the hashing commandline tool yourself, it is located here in your ffastrans folder:
Processors\resources\xxhsumX64.exe

example usage:
xxhsumX64.exe c:\temp\filename.mxf
By the way, @steinar: i recognized that actually it uses the 64bit algorithm in this case:

Code: Select all

If @OSArch = 'X64' Then $s_hash = ''
Which actually also means that when running on 32bit OS, the xxhash function might not work at all because the xxhsumX86.exe does not understand the parameter "-H0" and fails to create the checksum. One thing i did not understand at all is that xxhsumX86.exe seems to be a totally different tool than the x64 one, it accepts totally different parameters and spits out a totally different outputt (pipe separated instead of "hash space filename")

If my findings are correct this means the answer for @ThomasM is:
-) on 64bit OS, $xxhash will use the 64bit algorithm
-) the "initial value" is 0

Re: Which version of xxHash is used in FFAStrans?

Posted: Thu Sep 05, 2019 2:48 pm
by ThomasM
Hey Harry,

Thank you so much for clearing this up. Very interesting the opportunities to have a deep look inside OpenSource software. Even better to have someone who has an understanding of it all ;-)

regards,
tom

Re: Which version of xxHash is used in FFAStrans?

Posted: Tue Sep 10, 2019 5:42 pm
by admin
Hello guys, sorry for late response.

The xxhash implementation was supposed to be consistant between os architectures but obviously there's a bug here. Also, I found that the x86 hash output version would not be read correctly. So, the xxhash did probably NOT work on 32bit OS and gave as you pointed out 64bit hash on 64 bit.

Thanks for notifying!

-steinar

Re: Which version of xxHash is used in FFAStrans?

Posted: Fri Sep 13, 2019 6:12 pm
by emcodem
@ThomasM before i forget, in case you did not notice, this means that in the next version of ffastrans, xxhash will deliver a 32bit hash...

Re: Which version of xxHash is used in FFAStrans?

Posted: Sat Sep 14, 2019 4:21 pm
by ThomasM
Oh... Would it be possiblebto implement both? xxHash32 and xxHash64?

First workaround for us will be to mark the result as xxHash32=[nnnnn]

Have a nice weekend!
Tom