glaslos / ssdeep

SSDEEP hash lib in Golang
Other
100 stars 35 forks source link

Hash Interface #11

Closed glaslos closed 6 years ago

glaslos commented 6 years ago

Create an Hash compatible object for ongoing hashing.

davidt99 commented 6 years ago

Although the Hash interface doesn't "fit" ssdeep so well - it has some functions that aren't really relevant for ssdeep (BlockSize for example), it's common in other languages (i'm coming from python) that a hash function satisfy the language standard for hasing.

glaslos commented 6 years ago

Generally a good idea. But how do you implement that you always have to provide the file size first? SetSize(int) or a Init()? io.Writer kinda makes only sense if your hash can be updated without prior knowledge about the final amount of data.

davidt99 commented 6 years ago

Are we looking at the same Writer? I'm looking at this and the interface has only Write method. I already implemented the hash interface, just need to make sure everything is working and push it.

glaslos commented 6 years ago

Okay, looking forward how you have done this :)

glaslos commented 6 years ago

We decided to not go for the Hash interface. See comments in the PR and more specific here: https://github.com/glaslos/ssdeep/pull/15#issuecomment-354755865