(key string)
| 103 | } |
| 104 | |
| 105 | func (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 | } |