Replies: 9 comments 4 replies
-
In short, These are secure cryptographic functions using what some consider a much cleaner library than openSSL, and very much optimised as mbedTLS (as per the name) is often used on embedded or otherwise constrained devices. If I remember, for digest there is some disclaimer saying that for cryptographic purposes other libraries should be used. I can replicate the results from your benchmark in terms of the relative speed of sha256 hashing. If you are considering moving to sha256, which has become somewhat of a standard these days, the implementation in |
Beta Was this translation helpful? Give feedback.
-
Thanks for explaining, the stack definitely makes sense. I will keep it in mind in case I need sha256 and above or cryptographic guarantees. For |
Beta Was this translation helpful? Give feedback.
-
Out of curiosity, I exposed the I think I will leave it in for the next version of |
Beta Was this translation helpful? Give feedback.
-
Thanks! sha1 sounds great for generating unique names quickly for crew. |
Beta Was this translation helpful? Give feedback.
-
On this, However see the note above https://github.com/r-lib/rlang/blob/c55f6027928d3104ed449e591e8a225fcaf55e13/src/internal/hash.c#L120C15-L120C15 I am not sure how this behaviour compares to |
Beta Was this translation helpful? Give feedback.
-
Interesting. rlang has something for everything, doesn't it? I do need targets to guarantee stable hashes across different platforms, but this is still good for awareness. Thanks for the pointer. |
Beta Was this translation helpful? Give feedback.
-
I'm posting here as the more appropriate place to continue the conversation from #1139 (comment). Very rough-and-ready testing with 'xxhash64' within |
Beta Was this translation helpful? Give feedback.
-
Wow, that would be an incredible boon! Please keep me posted if this works out! I'm not committed to xxhash64, I'm just looking for something with the right balance of speed, memory usage, and avoidance of collisions. (But for short suffixes for dynamic branch names, a separate 32-bit hash would be nice to have as well.) |
Beta Was this translation helpful? Give feedback.
-
Would this be of interest, @wlandau ? https://github.com/coolbutuseless/xxhashlite |
Beta Was this translation helpful? Give feedback.
-
Prework
Proposal
SHA256 hashes from
nanonext
appear to be much faster than the analogous ones fromdigest
according to the benchmark below. So I wonder if it is worth considering switching tonanonext
to produce hashes for things thattargets
needs (hashes of R commands and files to check if a target is out of date). @shikokuchuo, are there plans to implement xxhash64 innanonext
? That is whattargets
currently uses.Benchmark
Created on 2023-03-17 with reprex v2.0.2
Beta Was this translation helpful? Give feedback.
All reactions