const require_stringify = require("./stringify.cjs");
const require_v1 = require("./v1.cjs");
const require_v1ToV6 = require("./v1ToV6.cjs");
//#region src/utils/uuid/v6.ts
function v6(options, buf, offset) {
	options ??= {};
	offset ??= 0;
	let bytes = require_v1.default({
		...options,
		_v6: true
	}, new Uint8Array(16));
	bytes = require_v1ToV6.default(bytes);
	if (buf) {
		if (offset < 0 || offset + 16 > buf.length) throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
		for (let i = 0; i < 16; i++) buf[offset + i] = bytes[i];
		return buf;
	}
	return require_stringify.unsafeStringify(bytes);
}
//#endregion
exports.default = v6;

//# sourceMappingURL=v6.cjs.map