MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / hashSecret

Function hashSecret

internal/config/config.go:1175–1182  ·  view source on GitHub ↗

hashSecret hashes the given secret using bcrypt.

(secret string)

Source from the content-addressed store, hash-verified

1173
1174// hashSecret hashes the given secret using bcrypt.
1175func hashSecret(secret string) (string, error) {
1176 // Use default cost for simplicity.
1177 hashedBytes, err := bcrypt.GenerateFromPassword([]byte(secret), bcrypt.DefaultCost)
1178 if err != nil {
1179 return "", err
1180 }
1181 return string(hashedBytes), nil
1182}
1183
1184// SaveConfigPreserveComments writes the config back to YAML while preserving existing comments
1185// and key ordering by loading the original file into a yaml.Node tree and updating values in-place.

Callers 1

LoadConfigOptionalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected