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

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -