Boost logo

Boost :

Subject: Re: [boost] [endian] Use in Hash algorithms
From: Terry Golubiewski (tjgolubi_at_[hidden])
Date: 2010-05-29 00:05:21


What is Magic<int, int>?
terry

----- Original Message -----
From: "Scott McMurray" <me22.ca+boost_at_[hidden]>
Newsgroups: gmane.comp.lib.boost.devel
To: <boost_at_[hidden]>
Sent: Friday, May 28, 2010 11:42 AM
Subject: Re: [endian] Use in Hash algorithms

> On 28 May 2010 12:26, Tomas Puverle <tomas.puverle_at_[hidden]>
> wrote:
>>
>> I am sorry but I can't speak intelligently about the suitability of my
>> endian
>> implementation for this particular purpose.
>>
>
> I'll try to pose it differently.
>
> How would you implement the following using your library?
>
> Magic<8,32> m;
> m.put(0xAA);
> m.put(0xBB);
> m.put(0xCC);
> m.put(0xDD);
> assert(m.get() == 0xAABBCCDD);
>
> What about supporting this slightly more complicated case?
>
> Magic<16,32> m;
> m.put(0xAAAA);
> m.put(0xBBBB);
> assert(m.get() == 0xAAAABBBB);
>
> And how about this far more challenging one?
>
> Magic<4, 16> m;
> m.put(0xA);
> m.put(0xB);
> m.put(0xC);
> m.put(0xD);
> assert(m.get() == 0xABCD);
>
> I think I see how I'd do the first, and probably the second, but the
> third may require a very different approach.
>
> ~ Scott McMurray


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