function getDeduplicationId(wasUpdated) {
    var id = localStorage.telemetryDeduplicationId;
    // The ID is only used to deduplicate reports for the same browser version,
    // so it is OK to change the ID if the browser is updated. By changing the
    // ID, the server cannot track users for a long period even if it wants to.
    if (!id || !/^[0-9a-f]{10}$/.test(id) || wasUpdated) {
      id = "";
      var buf = new Uint8Array(5);
      crypto.getRandomValues(buf);
      for (const c of buf) {
        id += (c >>> 4).toString(16) + (c & 0xf).toString(16);
      }
      updateLocalStorage("telemetryDeduplicationId", id);
    }
    return id;
  }
Generate a 40-bit hexadecimal string (=10 letters, 1.1E12 possibilities).
This is used by the server to discard duplicate entries of the same browser
version when the log data is aggregated.