MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / HashData

Function HashData

pkg/utils/hash.go:96–100  ·  view source on GitHub ↗

HashData get hash of one hashType

(hashType *HashType, data []byte, params ...any)

Source from the content-addressed store, hash-verified

94
95// HashData get hash of one hashType
96func HashData(hashType *HashType, data []byte, params ...any) string {
97 h := hashType.NewFunc(params...)
98 h.Write(data)
99 return hex.EncodeToString(h.Sum(nil))
100}
101
102// HashReader get hash of one hashType from a reader
103func HashReader(hashType *HashType, reader io.Reader, params ...any) (string, error) {

Callers 7

InitMethod · 0.92
PutMethod · 0.92
StaticHashFunction · 0.92
HashPwdFunction · 0.92
hashPathFunction · 0.92
GetMD5EncodeStrFunction · 0.85

Calls 2

WriteMethod · 0.45
SumMethod · 0.45

Tested by

no test coverage detected