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

Function generateKey

coderd/cryptokeys/rotate.go:244–251  ·  view source on GitHub ↗
(length int)

Source from the content-addressed store, hash-verified

242}
243
244func generateKey(length int) (string, error) {
245 b := make([]byte, length)
246 _, err := rand.Read(b)
247 if err != nil {
248 return "", xerrors.Errorf("rand read: %w", err)
249 }
250 return hex.EncodeToString(b), nil
251}
252
253func tokenDuration(feature database.CryptoKeyFeature) time.Duration {
254 switch feature {

Callers 2

generateNewSecretFunction · 0.70
handleClickFunction · 0.50

Calls 2

ReadMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected