1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/* ISC license. */ #include <sys/types.h> #include <skalibs/uint32.h> void uint32_reverse (char *s, size_t n) { while (n--) { char c = s[0] ; s[0] = s[3] ; s[3] = c ; c = s[1] ; s[1] = s[2] ; s[2] = c ; s += 4 ; } }