PHP 8.2.30
Preview: swap.js Size: 440 B
/home/byroehnu/.trash/node_modules11/unicode-trie/swap.js

const isBigEndian = (new Uint8Array(new Uint32Array([0x12345678]).buffer)[0] === 0x12);

const swap = (b, n, m) => {
  let i = b[n];
  b[n] = b[m];
  b[m] = i;
};

const swap32 = array => {
  const len = array.length;
  for (let i = 0; i < len; i += 4) {
    swap(array, i, i + 3);
    swap(array, i + 1, i + 2);
  }
};

const swap32LE = array => {
  if (isBigEndian) {
    swap32(array);
  }
};

module.exports = {
  swap32LE: swap32LE
};

Directory Contents

Dirs: 1 × Files: 6

Name Size Perms Modified Actions
test DIR
- drwxr-xr-x 2026-02-14 19:19:10
Edit Download
30.74 KB lrw-r--r-- 2026-02-14 19:19:10
Edit Download
5.14 KB lrw-r--r-- 2026-02-14 19:19:10
Edit Download
1.02 KB lrw-r--r-- 2026-02-14 19:19:10
Edit Download
683 B lrw-r--r-- 2026-02-14 19:19:10
Edit Download
2.35 KB lrw-r--r-- 2026-02-14 19:19:10
Edit Download
440 B lrw-r--r-- 2026-02-14 19:19:10
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).