The review of std.hash package
Walter Bright
newshound2 at digitalmars.com
Wed Aug 8 11:38:21 PDT 2012
On 8/8/2012 3:12 AM, Piotr Szturmaj wrote:
> Walter Bright wrote:
>>
>> auto result = file.byChunk(4096 * 1025).joiner.hash();
>>
>> The magic is that any input range that produces bytes could be used, and
>> that byte producing input range can be hooked up to the input of any
>> reducing function.
>
> Suppose you have a callback that will give you blocks of bytes to hash. Blocks
> of bytes come from a socket, but not a blocking one. Instead, socket uses
> eventing mechanism (libevent) to get notifications about its readiness.
>
> How would you use the hash API in this situation?
Have the callback supply a range interface to call the hash with.
More information about the Digitalmars-d
mailing list