MCPcopy Create free account
hub / github.com/astercloud/aster / hashContent

Function hashContent

pkg/memory/observation_compressor.go:494–498  ·  view source on GitHub ↗

辅助函数

(content string)

Source from the content-addressed store, hash-verified

492// 辅助函数
493
494func hashContent(content string) string {
495 h := sha256.New()
496 h.Write([]byte(content))
497 return hex.EncodeToString(h.Sum(nil))[:16]
498}
499
500func isValidFilePath(path string) bool {
501 // 排除常见的非文件路径

Callers 2

TestHashContentFunction · 0.85
CompressMethod · 0.85

Calls 1

WriteMethod · 0.65

Tested by 1

TestHashContentFunction · 0.68