Index: integer.cpp
===================================================================
--- integer.cpp	(revision 521)
+++ integer.cpp	(working copy)
@@ -2965,76 +2965,82 @@
 }
 
 template <class T>
-static Integer StringToInteger(const T *str)
+static Integer StringToInteger(const T *str, Integer::Radix radix)
 {
-	int radix;
-	// GCC workaround
-	// std::char_traits<wchar_t>::length() not defined in GCC 3.2 and STLport 4.5.3
-	unsigned int length;
-	for (length = 0; str[length] != 0; length++) {}
+    // GCC workaround
+    // std::char_traits<wchar_t>::length() not defined in GCC 3.2 and STLport 4.5.3
+    unsigned int length, rdx;
+    for (length = 0; str[length] != 0; length++) {}
 
-	Integer v;
+    Integer v;
 
-	if (length == 0)
-		return v;
+    if (length == 0)
+        return v;
 
-	switch (str[length-1])
-	{
-	case 'h':
-	case 'H':
-		radix=16;
-		break;
-	case 'o':
-	case 'O':
-		radix=8;
-		break;
-	case 'b':
-	case 'B':
-		radix=2;
-		break;
-	default:
-		radix=10;
-	}
+    if(radix == Integer::DEC)
+    {
+        switch (str[length-1])
+        {
+        case 'h':
+        case 'H':
+            rdx=16;
+            break;
+        case 'o':
+        case 'O':
+            rdx=8;
+            break;
+        case 'b':
+        case 'B':
+            rdx=2;
+            break;
+        default:
+            rdx=10;
+        }
+    }
+    else
+    {
+        rdx = (int)radix;
+    }
 
-	if (length > 2 && str[0] == '0' && str[1] == 'x')
-		radix = 16;
+    if (length > 2 && str[0] == '0' && str[1] == 'x')
+        rdx = 16;
 
-	for (unsigned i=0; i<length; i++)
-	{
-		int digit;
+    for (unsigned i=0; i<length; i++)
+    {
+        int digit;
 
-		if (str[i] >= '0' && str[i] <= '9')
-			digit = str[i] - '0';
-		else if (str[i] >= 'A' && str[i] <= 'F')
-			digit = str[i] - 'A' + 10;
-		else if (str[i] >= 'a' && str[i] <= 'f')
-			digit = str[i] - 'a' + 10;
-		else
-			digit = radix;
+        if (str[i] >= '0' && str[i] <= '9')
+            digit = str[i] - '0';
+        else if (str[i] >= 'A' && str[i] <= 'F')
+            digit = str[i] - 'A' + 10;
+        else if (str[i] >= 'a' && str[i] <= 'f')
+            digit = str[i] - 'a' + 10;
+        else
+            digit = rdx;
 
-		if (digit < radix)
-		{
-			v *= radix;
-			v += digit;
-		}
-	}
+        if (digit < rdx)
+        {
+            v *= rdx;
+            v += digit;
+        }
+    }
 
-	if (str[0] == '-')
-		v.Negate();
+    if (str[0] == '-')
+        v.Negate();
 
-	return v;
+    return v;
 }
 
-Integer::Integer(const char *str)
-	: reg(2), sign(POSITIVE)
+Integer::Integer(const char *str, Radix radix)
+: reg(2), sign(POSITIVE)
 {
-	*this = StringToInteger(str);
+    *this = StringToInteger(str, radix);
 }
 
-Integer::Integer(const wchar_t *str)
-	: reg(2), sign(POSITIVE)
+Integer::Integer(const wchar_t *str, Radix radix)
+: reg(2), sign(POSITIVE)
 {
-	*this = StringToInteger(str);
+    *this = StringToInteger(str, radix);
 }
 
 unsigned int Integer::WordCount() const
Index: integer.h
===================================================================
--- integer.h	(revision 521)
+++ integer.h	(working copy)
@@ -45,6 +45,8 @@
 		//!
 		enum Sign {POSITIVE=0, NEGATIVE=1};
 
+        enum Radix {BIN=2, DEC=10, HEX=16 };
+
 		//!
 		enum Signedness {
 		//!
@@ -81,8 +83,8 @@
 		/*! str can be in base 2, 8, 10, or 16.  Base is determined by a
 			case insensitive suffix of 'h', 'o', or 'b'.  No suffix means base 10.
 		*/
-		explicit Integer(const char *str);
-		explicit Integer(const wchar_t *str);
+		explicit Integer(const char *str, Radix radix=DEC);
+		explicit Integer(const wchar_t *str, Radix radix=DEC);
 
 		//! convert from big-endian byte array
 		Integer(const byte *encodedInteger, size_t byteCount, Signedness s=UNSIGNED);
