String::getLargeIntValue()?


#1

I’ve come across a weird bug. When I pass “99c661d4b78824de” as String value to that function, i mereley get 0x63. Here’s my own function which works correctly:

[code]int64 getInt64FromString(const String &id1s)
{
const char p=(const char)id1s;
int64 value=0;
int64 nibble;
for (int i=0; i<16; i++)
{
if (p[i]==0) break;

	if (p[i]>='0' && p[i]<='9')
		nibble=p[i]-'0';
	else if (p[i]>='a' && p[i]<='f')
		nibble=p[i]-'a'+10;
	else if (p[i]>='A' && p[i]<='F')
		nibble=p[i]-'A'+10;
	else nibble=0;

	value=(value<<4)|nibble;
}
return value;

}[/code]


#2

ahem… getLargeIntValue takes a decimal number, not hex…


#3

sorry, I think I’ll go to sleep now… :roll: