class Fremkit::Trees::Trie
- Fremkit::Trees::Trie
- Fremkit::Trees::MerkleTree(Slice(UInt8), Slice(UInt8), Slice(UInt8))
- Reference
- Object
Overview
Implements a hexary Merkle Patricia Tree (MPT), which is not backed by a data store: all values are stored in memory.
trie = Trie.new
trie.root_hash # => [86, 232, 31, 23, 27, 204, 85, 166, 255, 131, 69, 230, 146, 192, 248, 110, 91, 72, 224, 27, 153, 108, 173, 192, 1, 98, 47, 181, 227, 99, 180, 33]
Defined in:
common/trie.crConstant Summary
-
EmptyRoot =
Bytes[86, 232, 31, 23, 27, 204, 85, 166, 255, 131, 69, 230, 146, 192, 248, 110, 91, 72, 224, 27, 153, 108, 173, 192, 1, 98, 47, 181, 227, 99, 180, 33]
Constructors
Instance Method Summary
- #common_length(key : Bytes, prefix : Bytes) : UInt32
- #get!(key : Bytes) : Bytes
- #get?(key : Bytes) : Bytes | Nil
- #insert(key : Bytes, value : Bytes)
- #root_hash : Bytes