Class Mnemonic
Provides an easy way to create mnemonics from 32-byte length keys.
Inheritance
object
Mnemonic
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Algorand.Utils
Assembly: Algorand.dll
Syntax
public class Mnemonic
Methods
| Improve this Doc View SourceFromKey(byte[])
Converts a 32-byte key into a 25 word mnemonic. The generated mnemonic includes a checksum. Each word in the mnemonic represents 11 bits of data, and the last 11 bits are reserved for the checksum.
Declaration
public static string FromKey(byte[] key)
Parameters
Type | Name | Description |
---|---|---|
byte[] | key | 32 byte length key |
Returns
Type | Description |
---|---|
string | the mnemonic |
ToKey(string)
toKey converts a mnemonic generated using this library into the source key used to create it. It returns an error if the passed mnemonic has an incorrect checksum, if the number of words is unexpected, or if one of the passed words is not found in the words list.
Declaration
public static byte[] ToKey(string mnemonicStr)
Parameters
Type | Name | Description |
---|---|---|
string | mnemonicStr | words delimited by MNEMONIC_DELIM |
Returns
Type | Description |
---|---|
byte[] | 32 byte array key |