@douginamug I tend to send people this video when they ask what a hash function is/does: https://www.youtube.com/watch?v=b4b8ktEV4Bg

@douginamug

It's not a real *compression* hash function, rather a PRNG hash, but this is about as simple as I've seen:

https://github.com/jeremywohl/nacl/blob/515c9bf085b5154d553ecf04288936850819c788/try-anything.c#L46

@douginamug

Also this: https://cr.yp.to/salsa20.html

@douginamug A cryptographic hash function is a pseudorandom function

So.. off the top of my head...

any pseudorandom number generator should work, with the input acting as the seed.

So maybe a linear congruence generator would be a simple example.

https://en.wikipedia.org/wiki/Linear_congruential_generator

you might need to think a bit harder about this!

Maybe something like, your random number generator, acting as a block cipher and doing a Merkle Damgard constructed hash function

https://en.wikipedia.org/wiki/Merkle%E2%80%93Damg%C3%A5rd_construction

ajgae 🌿🐇🌫️@categorille@tech.lgbt@douginamug mod n is pretty cool imo. E.g. sum up the bytes that have to be hashed and take the mod n of the result. It's really simple but it does the job