Right now there is limited support for byteswapping. std.intrinsic includes bswap(uint), and std.system includes a predefined constant for system endianness.
It would be really helpful to have bswap equivalents for all basic datatypes, as well as routines to swap between native endianness and explicit big or little endian, ala ntohl, ntohs, htonl, htons
A related thing that would come in handy is byteswapping mmap support.
Comment #1 by caron800 — 2008-05-20T14:47:39Z
On 20/05/2008, [email protected] <[email protected]> wrote:
> It would be really helpful to have bswap equivalents for all basic datatypes,
Essentially, bswap(T)(T x)
> as well as routines to swap between native endianness and explicit big or
> little endian, ala ntohl, ntohs, htonl, htons
I never did understand the difference between ntoh* and hton*. :-)