()
| 265 | } |
| 266 | |
| 267 | function generateWorkspaceJoinCode(): string { |
| 268 | const bytes = randomBytes(JOIN_CODE_LENGTH); |
| 269 | let code = ""; |
| 270 | for (const byte of bytes) { |
| 271 | code += JOIN_CODE_ALPHABET[byte % JOIN_CODE_ALPHABET.length]; |
| 272 | } |
| 273 | return code; |
| 274 | } |
| 275 | |
| 276 | function normalizeWorkspaceJoinCode(joinCode: string): string { |
| 277 | return joinCode.trim().toUpperCase().replace(/[^A-Z0-9]/g, ""); |
no outgoing calls
no test coverage detected