Cryptography/CafeLib.Cryptography.UnitTests/BsvSharp/Passphrase/Mnemonic.cs
/// <summary>
/// Returns true if words encode binary data with a valid checksum.
/// If wordList is specified, then it is used.
/// Otherwise the wordList is selected based on the words provided.
/// If a wordList can't be determined, false is returned.
/// </summary>
/// <param name="words">A sequence of space separated words from wordList, or one of the standard WordLists</param>
/// <param name="wordList">Optional wordList to be used.</param>
/// <returns>Returns true if words encode binary data with a valid checksum.</returns>
Returns true if words encode binary data with a valid checksum.
If wordList is specified, then it is used.
Otherwise the wordList is selected based on the words provided.
If a wordList can't be determined, false is returned.
Returns true if words encode binary data with a valid checksum . If wordList is specified then it is used . Otherwise the wordList is selected based on the words provided . If a wordList can ' t be determined false is returned .
public static bool IsValid(string words, string[] wordList = null)
		{
			var bin = WordsToBinaryString(words, wordList);
			if (bin == null) return false;
			var (data, appendedChecksum) = BinaryStringToDataAndChecksum(bin);
			var dataChecksum = GetChecksum(data);
			return appendedChecksum == dataChecksum;
		}
public static bool IsValid ( string words , string [ ] wordList = null ) { var bin = WordsToBinaryString ( words , wordList ) ; if ( bin == null ) return false ; var ( data , appendedChecksum ) = BinaryStringToDataAndChecksum ( bin ) ; var dataChecksum = GetChecksum ( data ) ; return appendedChecksum == dataChecksum ; }
Returns true if words encode binary data with a valid checksum.
Returns true if words encode binary data with a valid checksum .
Returns true if words encode binary data with a valid checksum.
Returns true if words encode binary data with a valid checksum .
words
string
A sequence of space separated words from wordList, or one of the standard WordLists
A sequence of space separated words from wordList or one of the standard WordLists
wordList
string[]
Optional wordList to be used.
Optional wordList to be used .