This question already has an answer here:
Let say I want to truncate SHA256 to 128 bits. What would be the best way to minimize a probability of a collision and improve collision resistance?
- Taking the last 16 bytes
- Taking the first 16 bytes
- XORing the first 16 bytes and the last 16 bytes together
And should I assume that the same logic will apply for other hash functions from the SHA-2 set (like SHA516) as well as other hash functions in general, for example, SHA-1 or MD5?