Skip to content

The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.

366 B
Raw Blame
import { createHash } from "crypto";

const PROJECT_ID_SALT = "mercur-telemetry-v1";

/**
 * Same salt and encoding as `@mercurjs/core`, so a scaffolded project and the
 * server later built from it share one `project_id`.
 */
export const hashProjectKey = (input: string): string =>
  createHash("sha256").update(`${PROJECT_ID_SALT}:${input}`).digest("base64url");