Skip to main content
Glama
random.js994 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Random = void 0; class Random { /** * Returns `count` cryptographically secure random bytes */ static getBytes(count) { try { const globalObject = typeof window === "object" ? window : self; const cryptoApi = typeof globalObject.crypto !== "undefined" ? globalObject.crypto : globalObject.msCrypto; const out = new Uint8Array(count); cryptoApi.getRandomValues(out); return out; } catch { try { // eslint-disable-next-line @typescript-eslint/no-var-requires const crypto = require("crypto"); return new Uint8Array([...crypto.randomBytes(count)]); } catch { throw new Error("No secure random number generator found"); } } } } exports.Random = Random; //# sourceMappingURL=random.js.map

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MyronKoch-dev/osmosis-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server