vsdb_hash_db
An implementation of the
hash_db::HashDBtrait.
This crate provides an implementation of the hash_db::HashDB trait, based on the powerful vsdb crate.
Installation
Add this to your Cargo.toml:
[]
= "4.0.1"
Usage
vsdb_hash_db provides an implementation of the hash_db::HashDB trait, backed by vsdb.
use ;
use ;
// Define a type alias for the backend
type TrieBackend = ;
// Create a new Orphan instance
let mut orphan = new_dag_map_raw;
// Create a new TrieBackend
let mut db = new.unwrap;
// Insert a value and get its hash
let value = b"hello world";
let hash = db.insert;
// Retrieve the value using its hash
let retrieved_value = db.get.unwrap;
assert_eq!;
// Check if a hash exists
assert!;
// Remove the value
db.remove;
assert!;
License
This project is licensed under the MIT license.