MCPcopy Index your code
hub / github.com/pocketbase/pocketbase / RandomString

Function RandomString

tools/security/random.go:14–16  ·  view source on GitHub ↗

RandomString generates a cryptographically random string with the specified length. The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding.

(length int)

Source from the content-addressed store, hash-verified

12//
13// The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding.
14func RandomString(length int) string {
15 return RandomStringWithAlphabet(length, defaultRandomAlphabet)
16}
17
18// RandomStringWithAlphabet generates a cryptographically random string
19// with the specified length and characters set.

Callers 7

NewDefaultClientFunction · 0.92
SetRandomPasswordMethod · 0.92
onCollectionSaveExecuteFunction · 0.92
DryRunViewMethod · 0.92
setDefaultAuthOptionsMethod · 0.92
recordCreateFunction · 0.92
recordAuthMethodsFunction · 0.92

Calls 1

RandomStringWithAlphabetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…