eddelbuettel / digest

R package to create compact hash digests of R objects
https://eddelbuettel.github.io/digest
111 stars 47 forks source link

blake3: backport upstream patch for Big-endian platforms #205

Closed barracuda156 closed 2 months ago

barracuda156 commented 2 months ago

See: https://github.com/BLAKE3-team/BLAKE3/commit/0b13637ae31c2e7e1a471e39258606fabb01685e

@eddelbuettel This fixes blake3 for Big endian.

As for spooky hash, perhaps it is either to be disabled or left as is: it works on Big-endian, but computes different values, so it will fail comparisons against pre-computed Little-endian values. See: https://github.com/facebook/folly/blob/4c603f8c2add8d0228de0e073c5ae3ce9b02b6f3/folly/hash/SpookyHashV2.h#L35-L36 Also:

The hash would run, and it would produce equally good results, but they'd be different results from little-endian platforms. http://burtleburtle.net/bob/hash/spooky.html

eddelbuettel commented 2 months ago

Thanks for helping concretely with a patch, this is appreciated.

barracuda156 commented 2 months ago

@eddelbuettel Thank you for merging!

eddelbuettel commented 2 months ago

My pleasure, that was nicely on point.

Can you test the new branch / pr #206 where I no longer run tests for 'spookyhash' if on big endian?