XXH32 Module (xxHash)

Share your advanced PureBasic knowledge/code with the community.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: XXH32 Module (xxHash)

Post by wilbert »

forumuser wrote:That checksum contains the correct one (b6fe8a29) but it is affixed with "FFFFFFFF".
The function returns a long and the Hex() takes a long here as well. Should I just
strip it or is there a more elegant way?
It's very strange that it does so when you specify #PB_Long.
I added a custom hex procedure to the module named XXH32_Hex.
This should always return a 8 character string.

I'm considering to add a progress callback to the XXH32_FromFile procedure.
Don't know if it would be worth it or not.
Windows (x64)
Raspberry Pi OS (Arm64)
forumuser
User
User
Posts: 98
Joined: Wed Apr 18, 2018 8:24 am

Re: XXH32 Module (xxHash)

Post by forumuser »

I added a custom hex procedure to the module named XXH32_Hex
Yeah, now it's fine and I only get the expected hex value :D
I'm considering to add a progress callback to the XXH32_FromFile procedure
Would be a nice addition to allow a gui to display the current progress (for the current file)

Not only for _very_ large files but also for medium sized when they need to be read from a slow
device (hdds)...

I really love this module, now file content comparisons got so much faster...
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: XXH32 Module (xxHash)

Post by wilbert »

forumuser wrote:Would be a nice addition to allow a gui to display the current progress (for the current file)
I added a progress callback and also a new example in the first post which makes use of it.
Windows (x64)
Raspberry Pi OS (Arm64)
forumuser
User
User
Posts: 98
Joined: Wed Apr 18, 2018 8:24 am

Re: XXH32 Module (xxHash)

Post by forumuser »

I added a progress callback and also a new example in the first post which makes use of it
Works like a charm!
Everything
Enthusiast
Enthusiast
Posts: 224
Joined: Sat Jul 07, 2018 6:50 pm

Re: XXH32 Module (xxHash)

Post by Everything »

How about XXH3 (SSE2)?
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: XXH32 Module (xxHash)

Post by wilbert »

Everything wrote: Mon Apr 04, 2022 2:09 am How about XXH3 (SSE2)?
It seems to be very fast.
Personally I have no interest in doing an ASM implementation now a C backend is being added to PureBasic.
It just makes no sense to me to spend a lot of time in doing so and getting requests for a non ASM solution by users who are using the C backend.
Maybe you can find a C implementation that can be used with the C backend of PureBasic.
Windows (x64)
Raspberry Pi OS (Arm64)
Everything
Enthusiast
Enthusiast
Posts: 224
Joined: Sat Jul 07, 2018 6:50 pm

Re: XXH32 Module (xxHash)

Post by Everything »

Unfortunately, I haven't seen a C implementation yet.
At the moment I can offer libxxhash.dll (can be found also in msys64\mingw64 or inkscape distro) for testing the algorithm on Windows.
Note that it was built with slightly different compiler flags than the xxhsum.exe utility from the official repository, for example

Image

but in general this is not important
Post Reply