MCPcopy Create free account
hub / github.com/apitable/apitable / generateRandomString

Function generateRandomString

packages/core/src/utils/string.ts:26–34  ·  view source on GitHub ↗
(length = 20)

Source from the content-addressed store, hash-verified

24const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
25
26export function generateRandomString(length = 20): string {
27 let randomString = '';
28 const size = chars.length;
29 for (let i = 0; i < length; i++) {
30 const randomNumber = Math.floor(Math.random() * size);
31 randomString += chars[randomNumber];
32 }
33 return randomString;
34}
35
36export const MAX_NAME_STRING_LENGTH = 100;
37

Callers 11

getNewIdsFunction · 0.90
uuid.test.tsFile · 0.90
ops2ChangesetMethod · 0.90
resourceOpsToChangesetsFunction · 0.90
createActionMethod · 0.90
recoverRobotsMethod · 0.90
createTriggerMethod · 0.90
createRobotMethod · 0.90
ot.service.spec.tsFile · 0.90
initGlobalGrpcMetadataFunction · 0.90
initHttpHookFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected