summaryrefslogtreecommitdiffstats
path: root/src/hasher.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/hasher.rs')
-rw-r--r--src/hasher.rs5
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)
}
}