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

Function generateRandomString

wasm/image-add-on/src/test.js:75–87  ·  view source on GitHub ↗
(length = 1024)

Source from the content-addressed store, hash-verified

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

Callers 1

benchmarkFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected