diff options
| author | Santo Cariotti <santo@dcariotti.me> | 2025-06-16 14:34:48 +0000 |
|---|---|---|
| committer | Santo Cariotti <santo@dcariotti.me> | 2025-06-16 14:34:48 +0000 |
| commit | c97f558c45b4f40b352cb6a0edf3aa9f4b0474f2 (patch) | |
| tree | 2dbb1a0c533a01925925694c4cfb4c9fa5cca066 /src/hasher.rs | |
| parent | 481e019242fa6d487b56c7d6832bd6bea8fc7321 (diff) | |
Move proof tests and fix lifetime
Diffstat (limited to 'src/hasher.rs')
| -rw-r--r-- | src/hasher.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/hasher.rs b/src/hasher.rs index 77a8450..d27a7e5 100644 --- a/src/hasher.rs +++ b/src/hasher.rs @@ -15,8 +15,9 @@ pub trait Hasher { pub struct DummyHasher; impl Hasher for DummyHasher { - fn hash(&self, _input: &[u8]) -> String { - "0xc0ff3".to_string() + fn hash(&self, input: &[u8]) -> String { + let sum: u32 = input.iter().map(|&b| b as u32).sum(); + format!("hash_{:x}", sum) } } |
