| 34 | } // namespace |
| 35 | |
| 36 | Expect<std::filesystem::path> Cache::getPath(Span<const Byte> Data, |
| 37 | Cache::StorageScope Scope, |
| 38 | std::string_view Key) { |
| 39 | auto Root = getRoot(Scope); |
| 40 | if (!Key.empty()) { |
| 41 | Root /= std::filesystem::u8path(Key); |
| 42 | } |
| 43 | |
| 44 | Blake3 Hasher; |
| 45 | Hasher.update(Data); |
| 46 | std::array<Byte, 32> Hash; |
| 47 | Hasher.finalize(Hash); |
| 48 | std::string HexStr; |
| 49 | convertBytesToHexStr(Hash, HexStr); |
| 50 | |
| 51 | return Root / HexStr; |
| 52 | } |
| 53 | |
| 54 | void Cache::clear(Cache::StorageScope Scope, std::string_view Key) { |
| 55 | auto Root = getRoot(Scope); |
nothing calls this directly
no test coverage detected