News for hackers. Stuff that matters.
Re:The many flavors of hashing by Sniffnoy on Sunday July 31, 2022 @07:24PM (#32299891)
Since the OP is the author, I have to point out the following mistake:

> Related to the "looks random enough" aspect, because the input size is almost always larger than the output (which is fixed size), there are usually an infinite number of inputs for which the output is the same, thus these functions are not surjective.

The word you are looking for here is "injective", not "surjective".

Edit: As long as I'm pointing out wrong-word errors like this, I should probably also point out that the phrase is "bear with me", not "bare with me".

Re:The many flavors of hashing by jwilk on Monday August 01, 2022 @05:06AM (#32303599)
I hate the terms "injective" and "surjective". It's impossible for me to remember which is which.
Re:The many flavors of hashing by samatman on Monday August 01, 2022 @06:50AM (#32304223)
The way I remember it is that all three names are based on the image and codomain since the arguments/domain are total.

Sur- means 'upon' (sorta) as in sur-la-table, so we know the surjective is upon the entire codomain, hence surjective is the 'at least once' class, leaving injective as the 'at most once' class.

Bijective is the invertible one but I've never had problems remembering that and I note that you don't mention it either.

Re:The many flavors of hashing by jjitz on Sunday July 31, 2022 @11:12PM (#32301547)
well, they might also not be surjective :) but I guess we'll probably never know
Re:The many flavors of hashing by naniwaduni on Monday August 01, 2022 @02:49AM (#32302862)
Homework for Dantzig: show that [cryptographic hash] is surjective?
Re:The many flavors of hashing by ciprian_craciun on Monday August 01, 2022 @01:08AM (#32302285)
Thanks for both corrections, indeed you are right on both accounts.