code: function stringToUint8Array(str) {
    const arr = new Uint8Array(str.length);
    for (let i = 0, j = str.length; i < j; i++) {
      arr[i] = str.charCodeAt(i);
    }
    return arr;
  }
docs: Converts a String to a Uint8Array.
  @param {String} str string that should be converted
  @returns {Uint8Array}