This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // convex/helpers.ts | |
| import { NoOp } from "convex-helpers/server/customFunctions"; | |
| import { | |
| zCustomAction, | |
| zCustomMutation, | |
| zCustomQuery, | |
| } from "convex-helpers/server/zod4"; | |
| import { components } from "./_generated/api"; | |
| import type { Id } from "./_generated/dataModel"; | |
| import { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Simple and compatible ID generator | |
| const ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; | |
| function generateRandomString(length: number): string { | |
| let result = ""; | |
| const len = ALPHABET.length; | |
| const arr = new Uint8Array(length); | |
| // In modern environments (including Cloudflare Workers and Next.js), | |
| // crypto is always available on globalThis |