/
var
/
www
/
flurhymez
/
node_modules
/
charenc
/
/var/www/flurhymez/node_modules/charenc
mkdir
upload
Name
Size
Mode
Actions
charenc.js
850
0644
edit
dl
rm
LICENSE.mkd
1547
0644
edit
dl
rm
package.json
1256
0644
edit
dl
rm
README.js
54
0644
edit
dl
rm
Edit:
/var/www/flurhymez/node_modules/charenc/charenc.js
(850B)
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;
Save
cmd:
run