MCPcopy Create free account
hub / github.com/DFHack/dfhack / byteReverse

Function byteReverse

depends/md5/md5.cpp:17–27  ·  view source on GitHub ↗

* Note: this code is harmless on little-endian machines. */

Source from the content-addressed store, hash-verified

15 * Note: this code is harmless on little-endian machines.
16 */
17void byteReverse(unsigned char *buf, unsigned longs)
18{
19 uint32_t t;
20 do
21 {
22 t = (uint32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
23 ((unsigned) buf[1] << 8 | buf[0]);
24 *(uint32_t *) buf = t;
25 buf += 4;
26 } while (--longs);
27}
28#endif
29
30/*

Callers 2

MD5UpdateFunction · 0.85
MD5FinalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected