How to convert Javascript string to octet/character array? -


i know how convert normal javascript string array of octets/characters. classic c unsigned char array. using struct/jspack library , need extract/unpack values data coming in string.

thanks!

see string.charcodeat.

var str = 'abcdefghijklmnopqrstuvwxyz0123456789'; var result = []; for(var = 0, length = str.length; < length; i++) {     var code = str.charcodeat(i);     // since charcodeat returns between 0~65536, save every character 2-bytes     result.push(code & 0xff00, code & 0xff); } alert(result); 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -