import * as wasm from './uwurandom_wasm_bg.wasm'; const heap = new Array(32).fill(undefined); heap.push(undefined, null, true, false); function getObject(idx) { return heap[idx]; } let heap_next = heap.length; function dropObject(idx) { if (idx < 36) return; heap[idx] = heap_next; heap_next = idx; } function takeObject(idx) { const ret = getObject(idx); dropObject(idx); return ret; } const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); cachedTextDecoder.decode(); let cachedUint8Memory0 = new Uint8Array(); function getUint8Memory0() { if (cachedUint8Memory0.byteLength === 0) { cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer); } return cachedUint8Memory0; } function getStringFromWasm0(ptr, len) { return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); } function addHeapObject(obj) { if (heap_next === heap.length) heap.push(heap.length + 1); const idx = heap_next; heap_next = heap[idx]; heap[idx] = obj; return idx; } function handleError(f, args) { try { return f.apply(this, args); } catch (e) { wasm.__wbindgen_exn_store(addHeapObject(e)); } } function getArrayU8FromWasm0(ptr, len) { return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len); } /** */ export class Uwurandom { static __wrap(ptr) { const obj = Object.create(Uwurandom.prototype); obj.ptr = ptr; return obj; } __destroy_into_raw() { const ptr = this.ptr; this.ptr = 0; return ptr; } free() { const ptr = this.__destroy_into_raw(); wasm.__wbg_uwurandom_free(ptr); } /** * @returns {Uwurandom} */ static new() { const ret = wasm.uwurandom_new(); return Uwurandom.__wrap(ret); } /** * @returns {string} */ generate() { const ret = wasm.uwurandom_generate(this.ptr); return String.fromCodePoint(ret); } } export function __wbg_randomFillSync_6894564c2c334c42() { return handleError(function (arg0, arg1, arg2) { getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2)); }, arguments) }; export function __wbindgen_object_drop_ref(arg0) { takeObject(arg0); }; export function __wbg_getRandomValues_805f1c3d65988a5a() { return handleError(function (arg0, arg1) { getObject(arg0).getRandomValues(getObject(arg1)); }, arguments) }; export function __wbg_crypto_e1d53a1d73fb10b8(arg0) { const ret = getObject(arg0).crypto; return addHeapObject(ret); }; export function __wbindgen_is_object(arg0) { const val = getObject(arg0); const ret = typeof(val) === 'object' && val !== null; return ret; }; export function __wbg_process_038c26bf42b093f8(arg0) { const ret = getObject(arg0).process; return addHeapObject(ret); }; export function __wbg_versions_ab37218d2f0b24a8(arg0) { const ret = getObject(arg0).versions; return addHeapObject(ret); }; export function __wbg_node_080f4b19d15bc1fe(arg0) { const ret = getObject(arg0).node; return addHeapObject(ret); }; export function __wbindgen_is_string(arg0) { const ret = typeof(getObject(arg0)) === 'string'; return ret; }; export function __wbg_require_78a3dcfbdba9cbce() { return handleError(function () { const ret = module.require; return addHeapObject(ret); }, arguments) }; export function __wbindgen_string_new(arg0, arg1) { const ret = getStringFromWasm0(arg0, arg1); return addHeapObject(ret); }; export function __wbg_msCrypto_6e7d3e1f92610cbb(arg0) { const ret = getObject(arg0).msCrypto; return addHeapObject(ret); }; export function __wbindgen_is_function(arg0) { const ret = typeof(getObject(arg0)) === 'function'; return ret; }; export function __wbg_newnoargs_b5b063fc6c2f0376(arg0, arg1) { const ret = new Function(getStringFromWasm0(arg0, arg1)); return addHeapObject(ret); }; export function __wbg_call_97ae9d8645dc388b() { return handleError(function (arg0, arg1) { const ret = getObject(arg0).call(getObject(arg1)); return addHeapObject(ret); }, arguments) }; export function __wbg_self_6d479506f72c6a71() { return handleError(function () { const ret = self.self; return addHeapObject(ret); }, arguments) }; export function __wbg_window_f2557cc78490aceb() { return handleError(function () { const ret = window.window; return addHeapObject(ret); }, arguments) }; export function __wbg_globalThis_7f206bda628d5286() { return handleError(function () { const ret = globalThis.globalThis; return addHeapObject(ret); }, arguments) }; export function __wbg_global_ba75c50d1cf384f4() { return handleError(function () { const ret = global.global; return addHeapObject(ret); }, arguments) }; export function __wbindgen_is_undefined(arg0) { const ret = getObject(arg0) === undefined; return ret; }; export function __wbg_call_168da88779e35f61() { return handleError(function (arg0, arg1, arg2) { const ret = getObject(arg0).call(getObject(arg1), getObject(arg2)); return addHeapObject(ret); }, arguments) }; export function __wbg_buffer_3f3d764d4747d564(arg0) { const ret = getObject(arg0).buffer; return addHeapObject(ret); }; export function __wbg_new_8c3f0052272a457a(arg0) { const ret = new Uint8Array(getObject(arg0)); return addHeapObject(ret); }; export function __wbg_set_83db9690f9353e79(arg0, arg1, arg2) { getObject(arg0).set(getObject(arg1), arg2 >>> 0); }; export function __wbg_length_9e1ae1900cb0fbd5(arg0) { const ret = getObject(arg0).length; return ret; }; export function __wbg_newwithlength_f5933855e4f48a19(arg0) { const ret = new Uint8Array(arg0 >>> 0); return addHeapObject(ret); }; export function __wbg_subarray_58ad4efbb5bcb886(arg0, arg1, arg2) { const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0); return addHeapObject(ret); }; export function __wbindgen_object_clone_ref(arg0) { const ret = getObject(arg0); return addHeapObject(ret); }; export function __wbindgen_throw(arg0, arg1) { throw new Error(getStringFromWasm0(arg0, arg1)); }; export function __wbindgen_memory() { const ret = wasm.memory; return addHeapObject(ret); };