Cryptography/CafeLib.Cryptography.UnitTests/BsvSharp/Passphrase/Mnemonic.cs
/// <summary>
/// Converts a string of base 6 digits to a BitInteger.
/// The string can use either digits 1-6, or 0-5.
/// This is implemented by treating 6 and 0 as the same value 0.
/// </summary>
/// <param name="base6"></param>
/// <returns></returns>
Converts a string of base 6 digits to a BitInteger.
The string can use either digits 1-6, or 0-5.
This is implemented by treating 6 and 0 as the same value 0.
Converts a string of base 6 digits to a BitInteger . The string can use either digits 1 - 6 or 0 - 5 . This is implemented by treating 6 and 0 as the same value 0 .
public static BigInteger Base6ToBigInteger(string base6) 
		{
			if (string.IsNullOrWhiteSpace(base6)) return BigInteger.Zero;
			var n = new BigInteger(0);
			foreach (var c in base6.AsEnumerable())
			{
				var d = c - '0';
				if (d == 6) d = 0;
				if (d < 0 || d >= 6)
					throw new ArgumentException();
				n = n * 6 + d;
			}
			return n;
		}
public static BigInteger Base6ToBigInteger ( string base6 ) { if ( string . IsNullOrWhiteSpace ( base6 ) ) return BigInteger . Zero ; var n = new BigInteger ( 0 ) ; foreach ( var c in base6 . AsEnumerable ( ) ) { var d = c - ' ' ; if ( d == 6 ) d = 0 ; if ( d < 0 || d >= 6 ) throw new ArgumentException ( ) ; n = n * 6 + d ; } return n ; }
Converts a string of base 6 digits to a BitInteger.
Converts a string of base 6 digits to a BitInteger .
None
base6
string
None