MCPcopy Create free account
hub / github.com/breck7/scroll / getRandomString

Method getRandomString

external/.scrollLibs.js:14418–14426  ·  view source on GitHub ↗
(length = 30, letters = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""), seed = Date.now())

Source from the content-addressed store, hash-verified

14416 })
14417 }
14418 static getRandomString(length = 30, letters = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""), seed = Date.now()) {
14419 let str = ""
14420 const randFn = Utils._getPseudoRandom0to1FloatGenerator(seed)
14421 while (length) {
14422 str += letters[Math.round(Math.min(randFn() * letters.length, letters.length - 1))]
14423 length--
14424 }
14425 return str
14426 }
14427 // todo: add seed!
14428 static makeRandomParticles(lines = 1000, seed = Date.now()) {
14429 let str = ""

Callers 4

synthesizeAtomMethod · 0.80
_synthesizeAtomMethod · 0.80
_synthesizeAtomMethod · 0.80
_synthesizeAtomMethod · 0.80

Calls 3

splitMethod · 0.80
minMethod · 0.80

Tested by

no test coverage detected