code: function toByteArray(obj) {
    var uint = new Uint8Array(obj.length);
    for (var i = 0, l = obj.length; i < l; i++){
      uint[i] = obj.charCodeAt(i);
    }
  
    return new Uint8Array(uint);
  }
docs: only works for 8-bit chars