MCPcopy Create free account
hub / github.com/SwishHQ/spread / MD5

Function MD5

utils/common.go:139–144  ·  view source on GitHub ↗

given a string, return the md5 hash example: "hello" -> "5d41402abc4b2a76b9719d911017c592"

(str string)

Source from the content-addressed store, hash-verified

137// given a string, return the md5 hash
138// example: "hello" -> "5d41402abc4b2a76b9719d911017c592"
139func MD5(str string) string {
140 data := []byte(str)
141 has := md5.Sum(data)
142 md5str1 := fmt.Sprintf("%x", has)
143 return md5str1
144}
145
146// check if a pth exists
147func PathExists(path string) (bool, error) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected