Boost logo

Boost :

Subject: Re: [boost] Message Hashing Interface (SHA-1/256/384/512, MD4/5)
From: Scott McMurray (me22.ca+boost_at_[hidden])
Date: 2010-04-06 01:24:33


On 5 April 2010 20:01, Nevin Liber <nevin_at_[hidden]> wrote:
> On 4 April 2010 11:09, Scott McMurray <me22.ca+boost_at_[hidden]> wrote:
>> 2) The hash() function is const, and copies the accumulator, then pads
>> and length-appends the copied version, getting the hash from there
>> instead.  That gives perhaps the nicest interface, but the extra
>> copying would be somewhat expensive.
>
> I prefer this interface.  This is the same as Boost.CRC (and heck,
> std::string::c_str() for that matter).  If you still wish to provide a
> faster but destructive one, just use another function.
>

So x.hash() would then be copy(x).end_of_message()?

I could go for that.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk