MCPcopy Index your code
hub / github.com/TruthHun/BookStack / saltSecret

Function saltSecret

utils/password.go:124–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122}
123
124func saltSecret() (string, error) {
125 rb := make([]byte, randInt(10, 100))
126 _, err := rand.Read(rb)
127 if err != nil {
128 return "", err
129 }
130
131 return base64.URLEncoding.EncodeToString(rb), nil
132}
133
134func randInt(min int, max int) int {
135 return min + mt.Intn(max-min)

Callers 1

PasswordHashFunction · 0.85

Calls 2

randIntFunction · 0.85
ReadMethod · 0.45

Tested by

no test coverage detected