8Array([51, 114, 100]);      // "3rd"
  const message4 = new Uint8Array([52, 116, 104]);      // "4th"
  const message5 = new Uint8Array([108, 97, 115, 116]); // "last"

  const toUint8Array = buf => {
    return buf instanceof ArrayBuffer ? new Uint8Array(buf) : buf;
  }

  // convert ArrayBuffer or Uint8Array into string
  const toText = buf => {
    const arr = toUint8Array(buf);
    return !buf ? null : arr.reduce((result, item) => {
      return result + String.fromCharCode(item);
    }, '');
  }

  //