OutStream, TeeStream, Md5Stream, Sha1Stream, Crc32Stream, MD5, SHA1, CRC32, optimized C++ parser, CodeEditor annotations

git-svn-id: svn://ultimatepp.org/upp/trunk@487 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2008-09-28 18:15:28 +00:00
commit b0cc9c51af
26 changed files with 1312 additions and 822 deletions

View file

@ -501,6 +501,31 @@ String Decode64(const String& s)
}
}
String HexString(const byte *s, int count, int sep)
{
StringBuffer b(2 * count + (count - 1) / sep);
static const char itoc[] = "0123456789abcdef";
int i = 0;
char *t = b;
for(;;) {
for(int q = 0; q < sep; q++) {
if(i >= count)
return b;
*t++ = itoc[(s[i] & 0xf0) >> 4];
*t++ = itoc[s[i] & 0x0f];
i++;
}
if(i >= count)
return b;
*t++ = ' ';
}
}
String HexString(const String& s, int sep)
{
return HexString(s, s.GetCount(), sep);
}
String NormalizeSpaces(const char *s)
{
StringBuffer r;