MCPcopy Create free account
hub / github.com/danielmiessler/Fabric / ComputeStringHash

Function ComputeStringHash

internal/plugins/template/hash.go:31–35  ·  view source on GitHub ↗

ComputeStringHash returns hex-encoded SHA-256 hash of the given string

(s string)

Source from the content-addressed store, hash-verified

29
30// ComputeStringHash returns hex-encoded SHA-256 hash of the given string
31func ComputeStringHash(s string) string {
32 h := sha256.New()
33 h.Write([]byte(s))
34 return hex.EncodeToString(h.Sum(nil))
35}

Callers 5

TestComputeStringHashFunction · 0.85
TestHashConsistencyFunction · 0.85
RegisterMethod · 0.85
VerifyMethod · 0.85
GetExtensionMethod · 0.85

Calls

no outgoing calls

Tested by 2

TestComputeStringHashFunction · 0.68
TestHashConsistencyFunction · 0.68