import m from "./native.js";
import n from "./rng.js";
import { unsafeStringify as t } from "./stringify.js";
function U(r, a, u) {
  var e;
  if (m.randomUUID && !r)
    return m.randomUUID();
  r = r || {};
  const f = r.random ?? ((e = r.rng) == null ? void 0 : e.call(r)) ?? n();
  if (f.length < 16)
    throw new Error("Random bytes length must be >= 16");
  return f[6] = f[6] & 15 | 64, f[8] = f[8] & 63 | 128, t(f);
}
export {
  U as default
};
