# 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:

>>> import zlib
>>> import hashlib
>>> 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:

>>> len(zlib.compress(hashlib.sha256('data'.encode('utf-8')).digest()))
41
>>> len(hashlib.sha256('data'.encode('utf-8')).digest())
32