# Blake2: truncate 512-bit hash is safer than 256-bit by Config?

I need to calculate 256-bit hash in my code, using BLAKE2.

I know I can set BLAKE2 to generate itself a 256-bits hash for any data but I´m curious to know what can be safer and faster:

1- Create the 256-bit using Blake2Config module; or 2- Truncate the normal 512-bit result getting the leftmost 32 bytes (256 bits).

In a first time, I guess getting the leftmost 32 bytes can be safer and not so slower than get 256-bits from Blake directly.

Am I wrong? Thanks for any comments.

The config option is always equally good as / better than the manual truncation. In worst case (e.g. SHAKE) it's just simple truncation of an infinitely long key stream and thereby exhibits the same security properties as manual truncation. In best case (e.g. Skein) the selected output size will influence the output, i.e. Skein-256-256 will give a completely different output for a message $m$ than Skein-256-255 will. Obviously this is more secure (and usually not less fast) as it will guarantee you that $Trunc(H_{d}(m),t)\neq H_t(m)$ which may be a desirable property (although rarely needed).