Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is the sad NP-hard part of cryptographically-strong checksumming - the heavier the algorithm, the longer it'll take, and the harder it'll be to exhaust it on even trivial inputs.

Sometimes simply loading both copies of the data into RAM and comparing them can be faster - for scenarios where you have both copies available.

XXHash comes to mind as the (apparently) fastest non-cryptographic general-purpose hash out there at the moment; it runs close to memory speed. It would be interesting to see a microbenchmark-style graph showing the slowdown checking all permutations of 1KB, 1MB, etc.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: