(x, byte_length)
| 694 | |
| 695 | function 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); |