MCPcopy Index your code
hub / github.com/coder/coder / generateCryptoKey

Function generateCryptoKey

coderd/database/dbgen/dbgen.go:2170–2177  ·  view source on GitHub ↗
(length int)

Source from the content-addressed store, hash-verified

2168}
2169
2170func generateCryptoKey(length int) (string, error) {
2171 b := make([]byte, length)
2172 _, err := rand.Read(b)
2173 if err != nil {
2174 return "", xerrors.Errorf("rand read: %w", err)
2175 }
2176 return hex.EncodeToString(b), nil
2177}

Callers 1

newCryptoKeySecretFunction · 0.85

Calls 2

ReadMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected