diff options
Diffstat (limited to '')
| -rw-r--r-- | src/InMemoryBackend.cpp | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/InMemoryBackend.cpp b/src/InMemoryBackend.cpp deleted file mode 100644 index 8aebc65..0000000 --- a/src/InMemoryBackend.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "InMemoryBackend.h" - -#include <picosha2.h> - -namespace nt { - std::string InMemoryBackend::Put(std::vector<uint8_t> value) { - const std::string hash = picosha2::hash256_hex_string(value.begin(), value.end()); - kv_.emplace(hash, std::move(value)); - return hash; - } - - std::optional<std::vector<uint8_t>> InMemoryBackend::Get(const std::string& hash) { - auto it = kv_.find(hash); - if (it == kv_.end()) - return std::nullopt; - return it->second; - } -} // namespace nt |
