MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / getPath

Method getPath

lib/aot/cache.cpp:36–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34} // namespace
35
36Expect<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
54void Cache::clear(Cache::StorageScope Scope, std::string_view Key) {
55 auto Root = getRoot(Scope);

Callers

nothing calls this directly

Calls 5

getRootFunction · 0.85
convertBytesToHexStrFunction · 0.85
emptyMethod · 0.45
updateMethod · 0.45
finalizeMethod · 0.45

Tested by

no test coverage detected