swapBytes

fnT swapBytes(T)(T value) if (isIntegral!T) pure nothrow @nogc @safe

Swap bytes of an integral value.

This template function reverses the byte order of a given value.

Parameters

valueThe value whose bytes should be swapped.

Returns

The byte-swapped value.