MCPcopy Index your code
hub / github.com/googleworkspace/apps-script-samples / generateRandomString

Function generateRandomString

wasm/hello-world/src/test.js:77–89  ·  view source on GitHub ↗
(length = 1024)

Source from the content-addressed store, hash-verified

75}
76
77function generateRandomString(length = 1024) {
78 // Choose your desired character set
79 const characters =
80 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
81 const charactersLength = characters.length;
82
83 let result = "";
84 for (let i = 0; i < length; i++) {
85 result += characters.charAt(Math.floor(Math.random() * charactersLength));
86 }
87
88 return result;
89}

Callers 1

benchmarkFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected