diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-10-22 19:05:02 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-10-23 22:00:57 +0800 |
| commit | ee8daa37cb327d2f3fb011f54e0c566e0004435d (patch) | |
| tree | 6d3c631c12a7d6e2cd976ce197d5a6b2aede2b40 /src/hash_chain.rs | |
| parent | 71d5eadbc5ebe366da3af11dd8a010f55a83fd05 (diff) | |
fix: usage of hash_chain
fix: visibility of hash_chain funcs
Diffstat (limited to 'src/hash_chain.rs')
| -rw-r--r-- | src/hash_chain.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/hash_chain.rs b/src/hash_chain.rs index 0fe2c1d..f21b1d2 100644 --- a/src/hash_chain.rs +++ b/src/hash_chain.rs @@ -26,7 +26,7 @@ impl<T: Encode> HashChain<T> { this } - fn push(&mut self, data: T) { + pub fn push(&mut self, data: T) { let prev_hash = self .data .last() @@ -40,7 +40,7 @@ impl<T: Encode> HashChain<T> { // TODO: make try_last that does same as this but returns Err() if it's not the // last one and/or refuse to insert - fn insert(&mut self, data: T, base_hash: &Vec<u8>) { + pub fn insert(&mut self, data: T, base_hash: &Vec<u8>) { let pos = self .data .iter() @@ -53,7 +53,7 @@ impl<T: Encode> HashChain<T> { self.rehash(&base_hash); } - fn verify(&self, until_hash: &[u8]) -> bool { + pub fn verify(&self, until_hash: &[u8]) -> bool { let pos = self .data .iter() @@ -68,7 +68,7 @@ impl<T: Encode> HashChain<T> { }) } - fn rehash(&mut self, from_hash: &[u8]) { + pub fn rehash(&mut self, from_hash: &[u8]) { let pos = self .data .iter() |
