[Haskell-cafe] ANNOUNCE: hs-cryptohash 0.4

Vincent Hanquez tab at snarc.org
Sat Jul 3 03:08:40 EDT 2010

On 02/07/10 22:41, Gregory Crosswhite wrote:
> On 7/2/10 5:16 AM, Vincent Hanquez wrote:
>> It's necessary in my case since i receive chunks of data to be hashed 
>> from the
>> network, and I don't want to carry a buffer of data (with potential 
>> security
>> issues), until i can hash everything.
> As an aside, this kind of pattern where you are processing chunks of 
> input and producing a summary output sounds like a good fit for the 
> Iteratees style of I/O.

Indeed. I haven't played with iteratee yet, but it seems fairly easy for 
the user to add a iteratee interface on top of update and finalize. 
basically it seems that Chunk = update and EOF = finalize.

> Also, if you want the intermediate chunks to go away, then don't 
> forget to use strict evaluation when you update the context.  :-)  
> That is unfortunately one of the kinds of bugs that doesn't screw up 
> the behaviour of the program in a way that is immediately obvious.

yes, you're absolutely right. I did actually forget in an early version 
of some code i've got on top of cryptohash, and it took me a good while 
to find ;)


More information about the Haskell-Cafe mailing list