I assume that the hard part you are struggling with is converting to Rad36, not getting an integer value from a hexadecimal number represented as a string. So, here is a function that accepts unsigned __int64, converts it to Radix 36 and returns a string with the converted value.
string rad36(unsigned __int64 v)
{
string retval;
while( v > 0 )
{
unsigned m = v%36;
if( m <= 9 )
retval.insert(0,1,'0'+m);
else
retval.insert(0,1,'A'+m-10);
v /= 36;
}
return retval;
}
source
share