import { getNonCryptoRandomValues } from "../../../shared/src/random-values.js";
let sessionID = "";
function getSessionID() {
  if (sessionID === "") {
    const buf = new Uint8Array(4);
    getNonCryptoRandomValues(buf);
    sessionID = Array.from(buf, (x) => x.toString(16)).join("");
  }
  return sessionID;
}
const REQUEST_COUNTERS = /* @__PURE__ */ new Map();
function newRequestID(clientID) {
  const counter = REQUEST_COUNTERS.get(clientID) ?? 0;
  REQUEST_COUNTERS.set(clientID, counter + 1);
  return `${clientID}-${getSessionID()}-${counter}`;
}
export {
  newRequestID
};
//# sourceMappingURL=request-id.js.map
