BitSharper.Base58.DecodeToBigInteger C# (CSharp) Method

DecodeToBigInteger() public static method

public static DecodeToBigInteger ( string input ) : BigInteger
input string
return Org.BouncyCastle.Math.BigInteger
        public static BigInteger DecodeToBigInteger(string input)
        {
            var bi = BigInteger.ValueOf(0);
            // Work backwards through the string.
            for (var i = input.Length - 1; i >= 0; i--)
            {
                var alphaIndex = _alphabet.IndexOf(input[i]);
                if (alphaIndex == -1)
                {
                    throw new AddressFormatException("Illegal character " + input[i] + " at " + i);
                }
                bi = bi.Add(BigInteger.ValueOf(alphaIndex).Multiply(_base.Pow(input.Length - 1 - i)));
            }
            return bi;
        }