PHP 8.2.30
Preview: charenc.js Size: 850 B
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/charenc/charenc.js

var charenc = {
  // UTF-8 encoding
  utf8: {
    // Convert a string to a byte array
    stringToBytes: function(str) {
      return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
    },

    // Convert a byte array to a string
    bytesToString: function(bytes) {
      return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
    }
  },

  // Binary encoding
  bin: {
    // Convert a string to a byte array
    stringToBytes: function(str) {
      for (var bytes = [], i = 0; i < str.length; i++)
        bytes.push(str.charCodeAt(i) & 0xFF);
      return bytes;
    },

    // Convert a byte array to a string
    bytesToString: function(bytes) {
      for (var str = [], i = 0; i < bytes.length; i++)
        str.push(String.fromCharCode(bytes[i]));
      return str.join('');
    }
  }
};

module.exports = charenc;

Directory Contents

Dirs: 0 × Files: 4

Name Size Perms Modified Actions
850 B lrw-r--r-- 2026-02-21 00:53:32
Edit Download
1.51 KB lrw-r--r-- 2026-02-21 00:53:34
Edit Download
482 B lrw-r--r-- 2026-02-21 00:53:30
Edit Download
54 B lrw-r--r-- 2026-02-21 00:53:30
Edit Download

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