Can a compressed checksum be considered unique I'm kind of guessing that the answer may be no. Since the compression is trying to reduce the output size using various optimization methods, this may cancel the properties of a hash algorithm.

But take the following Python code:



&gt;&gt;&gt; import zlib
&gt;&gt;&gt; import hashlib
&gt;&gt;&gt; zlib.compress(hashlib.sha256('data'.encode('utf-8')).digest())


Can the output from the zlib compression be considered unique?

Note that since the hash value is quite random, it cannot be compressed efficiently:



&gt;&gt;&gt; len(zlib.compress(hashlib.sha256('data'.encode('utf-8')).digest()))
41
&gt;&gt;&gt; len(hashlib.sha256('data'.encode('utf-8')).digest())
32
TL;DR: The zlib output is at least as unique as the SHA-256 output.

Compression libraries like zlib have to encode the data in such a way that it is recoverably, which implies that they can not reduce the uncertainity (entropy) of the data.

Because of this logic, the entropy of the encoded hash has to be the same as the one of the hash. Now as hashes tend to have near-perfect entropy, this means that the the encoded data has the at least same entropy and thus must be at least as unique as the hash itself. Additionally, the compression may work non-deterministically when encoding data and thus even add entropy resulting in multiple unique encodings of the same hash (thus "increasing" the uniqueness).