const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
const require_stringify = require('./stringify.cjs');
const require_parse = require('./parse.cjs');

//#region ../../node_modules/samlify/node_modules/uuid/dist/esm-node/v35.js
function stringToBytes(str) {
	str = unescape(encodeURIComponent(str));
	const bytes = [];
	for (let i = 0; i < str.length; ++i) bytes.push(str.charCodeAt(i));
	return bytes;
}
function v35_default(name, version, hashfunc) {
	function generateUUID(value, namespace, buf, offset) {
		if (typeof value === "string") value = stringToBytes(value);
		if (typeof namespace === "string") namespace = require_parse.default(namespace);
		if (namespace.length !== 16) throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
		let bytes = new Uint8Array(16 + value.length);
		bytes.set(namespace);
		bytes.set(value, namespace.length);
		bytes = hashfunc(bytes);
		bytes[6] = bytes[6] & 15 | version;
		bytes[8] = bytes[8] & 63 | 128;
		if (buf) {
			offset = offset || 0;
			for (let i = 0; i < 16; ++i) buf[offset + i] = bytes[i];
			return buf;
		}
		return require_stringify.default(bytes);
	}
	try {
		generateUUID.name = name;
	} catch (err) {}
	generateUUID.DNS = DNS;
	generateUUID.URL = URL;
	return generateUUID;
}
var DNS, URL;
var init_v35 = require_rolldown_runtime.__esm({ "../../node_modules/samlify/node_modules/uuid/dist/esm-node/v35.js": (() => {
	require_stringify.init_stringify();
	require_parse.init_parse();
	DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
	URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
}) });

//#endregion
init_v35();
exports.default = v35_default;
Object.defineProperty(exports, 'init_v35', {
  enumerable: true,
  get: function () {
    return init_v35;
  }
});
//# sourceMappingURL=v35.cjs.map