MCPcopy Create free account
hub / github.com/violentmonkey/violentmonkey / getRandomString

Function getRandomString

src/common/util.js:65–69  ·  view source on GitHub ↗
(minLength = 10, maxLength = 0)

Source from the content-addressed store, hash-verified

63export function noop() {}
64
65export function getRandomString(minLength = 10, maxLength = 0) {
66 for (let rnd = ''; (rnd += Math.random().toString(36).slice(2));) {
67 if (rnd.length >= minLength) return maxLength ? rnd.slice(0, maxLength) : rnd;
68 }
69}
70
71export function getUniqId(prefix = 'VM') {
72 return prefix + getRandomString();

Callers 2

getCodeVerifierFunction · 0.90
getUniqIdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected