There's always a huge focus on speed in these type of articles, and rightfully so for most applications.<p>However, I often find myself in situations where I care neither about speed nor any other of the traditional performance metrics (memory consumption, latency, bandwidth, parallelizability, etc ...).<p>In these situations, what I actually care about is:<p><pre><code> a) code size (as in: fits compiled in 512 bytes)
b) code simplicity (as in: fits in head, takes up around 20 C++ LOC)
</code></pre>
Very unfortunately, there are very, very few algorithms that are designed to optimize along these lines.<p>Exceptions:<p>TEA : <a href="https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm" rel="nofollow">https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm</a><p>Speck: <a href="https://en.wikipedia.org/wiki/Speck_(cipher)" rel="nofollow">https://en.wikipedia.org/wiki/Speck_(cipher)</a><p>Both of these are ciphers, and both can be perverted into becoming hashes for various scenarios.<p>But, there aren't any compression or <i>native</i> crypto-hard hashing algorithms that I know of that are specifically designed to optimize along that particular dimension.<p>Blake3 or zstd are <i>large</i> pieces of code.