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

php - How can I edit my code to echo the data of child's element where my search term was found in, in XMLReader? -

jQuery Ajax Render Fragments OR Whole Page -

java - Why is BlockingQueue.take() not releasing the thread? -