import { v5, v6 } from "@langchain/core/utils/uuid";
//#region src/id.ts
let lastMsecs = 0;
let lastNsecs = 0;
function uuid6(clockseq) {
	let msecs = Date.now();
	if (msecs <= lastMsecs) {
		lastNsecs += 1;
		if (lastNsecs >= 1e4) {
			lastNsecs = 0;
			msecs = lastMsecs + 1;
		}
	} else lastNsecs = 0;
	lastMsecs = msecs;
	return v6({
		clockseq,
		msecs,
		nsecs: lastNsecs
	});
}
function uuid5(name, namespace) {
	const namespaceBytes = namespace.replace(/-/g, "").match(/.{2}/g).map((byte) => parseInt(byte, 16));
	return v5(name, new Uint8Array(namespaceBytes));
}
//#endregion
export { uuid5, uuid6 };

//# sourceMappingURL=id.js.map