MCPcopy Create free account
hub / github.com/53AI/53AIHub / calculateFileHash

Function calculateFileHash

api/controller/wps.go:139–144  ·  view source on GitHub ↗

calculateFileHash 计算文件内容的SHA256哈希

(fileContent []byte)

Source from the content-addressed store, hash-verified

137
138// calculateFileHash 计算文件内容的SHA256哈希
139func calculateFileHash(fileContent []byte) string {
140 hash := sha256.New()
141 hash.Write(fileContent)
142 hashInBytes := hash.Sum(nil)
143 return hex.EncodeToString(hashInBytes)
144}
145
146// generateUniqueFileName 生成唯一的文件名,如果重复则添加序号
147func generateUniqueFileName(eid, libraryID int64, dirPath, fileName, extension string, excludeFileID int64) string {

Callers 1

executeWPSFileUploadFunction · 0.85

Calls 2

NewMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected