MCPcopy Create free account
hub / github.com/GamerHack/GamerHack.github.io / swap_bytes

Function swap_bytes

g2all/700/lapse.js:696–703  ·  view source on GitHub ↗
(x, byte_length)

Source from the content-addressed store, hash-verified

694
695function double_free_reqs2(sds) {
696 function swap_bytes(x, byte_length) {
697 let res = 0;
698 for (let i = 0; i < byte_length; i++) {
699 res |= ((x >> (8 * i)) & 0xff) << (8 * (byte_length - i - 1));
700 }
701
702 return res >>> 0;
703 }
704
705 function htons(x) {
706 return swap_bytes(x, 2);

Callers 2

htonsFunction · 0.70
htonlFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected