bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: possible bug in sha and crc32 digest classes


From: Chad Yates
Subject: RE: possible bug in sha and crc32 digest classes
Date: Tue, 31 Dec 2002 19:04:15 -0800

cvs, updated this morning.  I'll check it out. thanks

> -----Original Message-----
> From: Elizabeth Barham [mailto:address@hidden
> Sent: Tuesday, December 31, 2002 6:44 PM
> To: Chad Yates
> Cc: address@hidden
> Subject: Re: possible bug in sha and crc32 digest classes
> 
> 
> Chad, 
> 
>    Are you using the CVS version or the regular download version? I
> was going over the code on the web viewcvs thing:
> 
> template <class int_type>
> std::ostream & SHATumbler<int_type>::toString(std::ostream & os)
> {
>       unsigned i;
>       unsigned long h1, h2;
>       for(i = 0 ; i < (unsigned)size ; i++) {
>               
> #ifdef DEBUG_SHATUMBLER
>               if(i != 0)
>                       os << " ";
> #endif
> 
> #if defined(WIN32) && !defined(__MINGW32__)
>               h1 = h[i] / 0x10000;
>               h2 = h[i] % 0x10000;
> #else
>               h1 = h[i] / 0x10000LL;
>               h2 = h[i] % 0x10000LL;
> #endif
> 
>               os << std::hex << std::setw(sizeof(h1) * 2) << 
>                       std::setfill('0') << h1;
> 
>               os << std::hex << std::setw(sizeof(h2) * 2) << 
>                       std::setfill('0') << h2;
>       }
>       return(os);
> }
> 
> The h1 and h2 are not in the download'd code and I did not use them
> originally IIRC.
> 
>    Anyway, if you are using the CVS code, this might possibly be where
> the extra 0's are showing up.
> 
> Elizabeth



reply via email to

[Prev in Thread] Current Thread [Next in Thread]