A simple algorithm to convert a binary string to a decimal number in time. For each character in the string the result is multiplied by and if the character is a
1 then is added to the result. If a non
1 character is seen the conversion stops.