No way to get cross-platform hashes #73

Closed
ekmett opened this Issue Sep 5, 2013 · 3 comments

Projects

None yet

2 participants

@ekmett
Contributor
ekmett commented Sep 5, 2013

Hashable has become the defacto way to hash in Haskell.

However, there is no way to get a hash that is consistent across platforms with different sizes for Int at this time.

This means incurring a constraint for another class, when users have frankly grown used to using and supplying instances for this one.

I'm mostly posting this to note that there is an issue, not necessarily crying out for an immediate resolution.

@tibbe
Owner
tibbe commented Sep 5, 2013

This is by design I'm afraid. An API for crass platform hashing must necessarily talk about exactly which hash function is used, which we un purpose don't (so we can optimize for the case of fast hash-based data structures).

@ekmett
Contributor
ekmett commented Sep 5, 2013

I have a fast hash-based data structure. I just need to be able to serialize it to disk when I'm done. ;)

In all seriousness I do understand, but it still makes me sad. =P

@tibbe
Owner
tibbe commented Sep 5, 2013

Engineering is all about trade-offs unfortunately. We recently had to make a difficult trade-off between security by default vs performance/purity when it came to using SipHash as the default string hashing algorithm.

@tibbe tibbe closed this Sep 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment