(x, byte_length)
| 670 | |
| 671 | function double_free_reqs2(sds) { |
| 672 | function swap_bytes(x, byte_length) { |
| 673 | let res = 0; |
| 674 | for (let i = 0; i < byte_length; i++) { |
| 675 | res |= ((x >> 8 * i) & 0xff) << 8 * (byte_length - i - 1); |
| 676 | } |
| 677 | |
| 678 | return res >>> 0; |
| 679 | } |
| 680 | |
| 681 | function htons(x) { |
| 682 | return swap_bytes(x, 2); |