Skip to main content
Glama
Hash.ts379 B
import { obj2String } from "./Json.js"; export const obj2Hash = (obj: any): number => { return str2Hash(obj2String(obj)); }; export const str2Hash = (str: string): number => { let hash = 0; for (let i = 0; i < str.length; i++) { const code = str.charCodeAt(i); hash = (hash << 5) - hash + code; hash = hash & hash; } return hash; };

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/Yuki4-dev/grpc-mcp'

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