TSTRING cCRC32Signature::AsStringHex() const
{
    TOSTRINGSTREAM ss;

    ss.imbue( std::locale::classic() );
    ss.setf( ios::hex, ios::basefield );

    ss << (size_t)mCRCInfo.crc;

    return ss.str();
}
///////////////////////////////////////////////////////////////////////////////
// GetHostID
///////////////////////////////////////////////////////////////////////////////
void cUnixFSServices::GetHostID(TSTRING& name) const
{
    TOSTRINGSTREAM ret;

    ret.setf(ios_base::hex, ios_base::basefield);
#ifdef HAVE_GETHOSTID
    ret << gethostid();
#else
    ret << 999999;
#endif
}
TSTRING cChecksumSignature::AsStringHex() const
{
    TOSTRINGSTREAM ss;

    ss.imbue( std::locale::classic() );
    ss.setf( ios::hex, ios::basefield );
    
    ASSERT( false ); 
    ss << (size_t)(uint32) mChecksum; // TODO:BAM -- this is truncating a 64-bit value to 32 bits!

    return ss.str();
}
TSTRING cCharEncoderUtil::char_to_hex( TCHAR ch )
{
    TOSTRINGSTREAM ss;

    ss.imbue( std::locale::classic() );
    ss.fill ( _T('0') );
    ss.width( TCHAR_AS_HEX__IN_TCHARS );
    ss.setf( std::ios_base::hex, std::ios_base::basefield );

    ss << tss::util::char_to_size( ch );

    if( ss.bad() || ss.fail() || 
        ss.str().length() != TCHAR_AS_HEX__IN_TCHARS )
        ThrowAndAssert( eBadHexConversion( TSTRING( 1, ch ) ) );
    return ss.str();
}