MCPcopy Index your code
hub / github.com/filebrowser/filebrowser / getFileName

Method getFileName

diskcache/file_cache.go:105–110  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

103}
104
105func (f *FileCache) getFileName(key string) string {
106 hasher := sha1.New()
107 _, _ = hasher.Write([]byte(key))
108 hash := hex.EncodeToString(hasher.Sum(nil))
109 return fmt.Sprintf("%s/%s/%s", hash[:1], hash[1:3], hash)
110}

Callers 3

StoreMethod · 0.95
DeleteMethod · 0.95
openMethod · 0.95

Implementers 2

NoOpdiskcache/noop_cache.go
FileCachediskcache/file_cache.go

Calls

no outgoing calls

Tested by

no test coverage detected