What is SHA-512/256 Generator?
SHA-512/256 is a truncated variant of SHA-512, defined in FIPS PUB 180-4. It uses the SHA-512 algorithm with a different initialization vector and truncates the output to 256 bits (32 bytes), producing a 64-character hexadecimal string — the same output length as SHA-256. The critical advantage over standard SHA-256 is twofold: on 64-bit hardware, SHA-512/256 is faster than SHA-256 because 64-bit operations process data in larger chunks; and SHA-512/256 is not vulnerable to length-extension attacks, which affect SHA-256 and SHA-512 when used directly as MACs. Length-extension attacks allow an adversary who knows H(message) to compute H(message || padding || extension) without knowing the original key. SHA-512/256 is increasingly recommended for applications where SHA-256 performance and output size are desired without its length-extension vulnerability.