Which version of xxHash is used in FFAStrans?

Questions and answers on how to get the most out of FFAStrans
Post Reply
ThomasM
Site Admin
Posts: 231
Joined: Wed Feb 22, 2017 6:36 am

Which version of xxHash is used in FFAStrans?

Post 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
admin
Site Admin
Posts: 1687
Joined: Sat Feb 08, 2014 10:39 pm

Re: Which version of xxHash is used in FFAStrans?

Post 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
ThomasM
Site Admin
Posts: 231
Joined: Wed Feb 22, 2017 6:36 am

Re: Which version of xxHash is used in FFAStrans?

Post 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
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: Which version of xxHash is used in FFAStrans?

Post 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
emcodem, wrapping since 2009 you got the rhyme?
ThomasM
Site Admin
Posts: 231
Joined: Wed Feb 22, 2017 6:36 am

Re: Which version of xxHash is used in FFAStrans?

Post by ThomasM »

Hey emcodem,

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
admin
Site Admin
Posts: 1687
Joined: Sat Feb 08, 2014 10:39 pm

Re: Which version of xxHash is used in FFAStrans?

Post 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
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: Which version of xxHash is used in FFAStrans?

Post 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...
emcodem, wrapping since 2009 you got the rhyme?
ThomasM
Site Admin
Posts: 231
Joined: Wed Feb 22, 2017 6:36 am

Re: Which version of xxHash is used in FFAStrans?

Post 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
Post Reply