Which algorithm to detect errors in 32bit data with 8bit parity I want to transmit a 32bit message in eight groups of 5bit each. This leaves me with 8bits to use for error checking.

Overall, a group is likely transmitted without error, but when there is an error transmitting a group, there are probably multiple bits wrong.

If I use one parity bit per group, I have a 50% chance to detect a wrong group. But I don't need to know which group of a message is wrong, I want to check the entire message.

I want 100% chance of detecting if one group of the message is incorrect, regardless of how many bits are flipped in that group. If possible, I also want to be able to check wheather two neighboring groups have been switched.

Which algorithm should I use for error checking / How should I code the data?
Think of your message as seven 5-bit numbers $x_2,\ldots,x_8 \in \{0,\ldots,30\}$. This gives you $7\log_2 31 \approx 34.68$ message bits. Calculate $x_1 = -\sum_{i=2}^8 ix_i \bmod{31}$, so that
$$
\sum_{i=1}^8 ix_i \equiv 0 \pmod{31}.
$$

It is easy to check that every single symbol error is detected, since $31$ is prime.

Now suppose that $x_i$ and $x_j$ are switched, but the equation above still holds. Then $ix_i + jx_j \equiv ix_j + jx_i$, and so $(i-j)(x_i - x_j) \equiv 0$, implying that either $i = j$ or $x_i = x_j$.