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: Elizabeth Barham
Subject: Re: possible bug in sha and crc32 digest classes
Date: 31 Dec 2002 20:43:42 -0600

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]