Node.js examples for String:Base 64
Convert string to byte array
function stringToByteArray(s){ // Otherwise, fall back to 7-bit ASCII only var result = new Uint8Array(s.length); for (var i=0; i<s.length; i++){ result[i] = s.charCodeAt(i);/* w ww. ja v a 2s . co m*/ } return result; }