Since the OP is the author, I have to point out the following mistake:<p>> 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.<p>The word you are looking for here is "injective", not "surjective".<p>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".
This article dances around the problem of encrypting small values a bunch. Here's a Rogaway paper on how to do it:<p><a href="https://www.cs.ucdavis.edu/~rogaway/papers/thorp.pdf" rel="nofollow">https://www.cs.ucdavis.edu/~rogaway/papers/thorp.pdf</a><p>(You do not need to limit yourself to inputs that are multiples of the AES block size).<p>There's another one like this, I forget the name.<p>SHA-2 is just fine, and is usually a saner choice than SHA-3 (if you want to be a crypto-hipster, use Blake2, not SHA-3; it's usually an easier dep to pull in, and more things use it).
The section about signature hashes could use some improvement. Cryptographic hashes have multiple use cases. The main one that comes to mind is basically just secure checksum/integrity hashes where you want to guarantee nobody could force a collision. For this case, all the scary warnings about "don't use these algorithms directly" makes no sense.
I once had a need for permutation hashing as part of a 2D sampling algorithm. My approach was to compose the hash using only reversible steps (to ensure that it's a permutation), and then use cycle walking to reduce the domain size from a power-of-two down to an arbitrary non-power-of-two size if needed.<p>I published my implementation in the Pseudorandom Permutations section of my "Correlated Multi-Jittered Sampling" tech report: <a href="https://graphics.pixar.com/library/MultiJitteredSampling/paper.pdf" rel="nofollow">https://graphics.pixar.com/library/MultiJitteredSampling/pap...</a>