sync-mht-0.3.8.3: Fast incremental file transfer using Merkle-Hash-Trees

Safe HaskellNone
LanguageHaskell2010

Sync.MerkleTree.Trie

Synopsis

Documentation

data Trie a Source

Constructors

Trie 

Fields

t_hash :: !Hash
 
t_node :: !(TrieNode a)
 

Instances

Eq a => Eq (Trie a) Source 
Show a => Show (Trie a) Source 

data TrieNode a Source

Constructors

Node !(Array Int (Trie a)) 
Leave !(Set a) 

Instances

Eq a => Eq (TrieNode a) Source 
Show a => Show (TrieNode a) Source 

data TrieLocation Source

Constructors

TrieLocation 

Fields

tl_level :: !Int

Must be nonnegative

tl_index :: !Int

Must be between nonnegative and smaller than (degree^tl_level)

data Fingerprint Source

Fingerprint of a Merkle-Hash-Tree node We asssume the Tree below a node is identical while synchronizing if its FingerPrint is

Constructors

Fingerprint 

Fields

f_hash :: !Hash
 
f_nodeType :: !NodeType
 

mkTrie :: (Ord a, HasDigest a) => Int -> [a] -> Trie a Source

Creates a Merkle-Hash-Tree for a list of elements

groupOf :: HasDigest a => Int -> a -> Int Source

The function groupOf x eeturns a value between 0 to degree-1 for a digest with the property that groupOf forms an approximate unviversal hash familiy.

mkLeave :: (HasDigest a, Ord a) => [a] -> Trie a Source

lookup :: Monad m => Trie a -> TrieLocation -> m (Trie a) Source

querySet :: (Ord a, Monad m) => Trie a -> TrieLocation -> m (Set a) Source

getAll :: Ord a => Trie a -> Set a Source