Struct Mnemonic
Byte struct representing a private key encoded with Length words.
Assembly: cs.temp.dll.dll
Syntax
[Serializable]
public struct Mnemonic : IEquatable<Mnemonic>
Fields
BitsPerWord
The number of bits encoded by each word.
Declaration
public const int BitsPerWord = 11
Field Value
ChecksumIndex
Index of the word used for the checksum.
Declaration
public const int ChecksumIndex = 24
Field Value
Length
Number of words contained in the mnemonic.
Declaration
public const int Length = 25
Field Value
SizeBytes
Size of Mnemonic in bytes.
Declaration
public const int SizeBytes = 50
Field Value
Properties
Item[Int32]
The word at a given index.
Declaration
public Mnemonic.Word this[int index] { get; set; }
Parameters
Type |
Name |
Description |
Int32 |
index |
The index of the word.
|
Property Value
Type |
Description |
Mnemonic.Word |
A word in the set of possible mnemonic words.
|
Methods
Equals(Mnemonic)
Declaration
public bool Equals(Mnemonic other)
Parameters
Returns
FromKey(PrivateKey)
Declaration
public static Mnemonic FromKey(PrivateKey key)
Parameters
Returns
FromString(String)
Convert a mnemonic from a string.
Declaration
public static Mnemonic FromString(string mnemonicString)
Parameters
Type |
Name |
Description |
String |
mnemonicString |
The 25 word mnemonic in a string, with each word separated by spaces.
|
Returns
Type |
Description |
Mnemonic |
A mnemonic parsed from the string.
|
Exceptions
Type |
Condition |
ArgumentException |
If the mnemonic string cannot be parsed, this error is thrown.
|
GetUnsafePtr()
Get the byte pointer at the start of this struct.
Declaration
public byte *GetUnsafePtr()
Returns
Type |
Description |
Byte* |
An unsafe byte pointer.
|
ToPrivateKey()
Declaration
public PrivateKey ToPrivateKey()
Returns
ToString()
Declaration
public override string ToString()
Returns
Overrides
TryParse(ReadOnlySpan<Char>, out Mnemonic)
Try to parse a mnemonic from a string.
Declaration
public static Mnemonic.ParseError TryParse(ReadOnlySpan<char> mnemonicString, out Mnemonic mnemonic)
Parameters
Type |
Name |
Description |
ReadOnlySpan<Char> |
mnemonicString |
The mnemonic string of 25 words separated by space.
|
Mnemonic |
mnemonic |
The mnemonic parsed from the mnemonic string.
|
Returns
Operators
Implicit(Mnemonic to String)
Declaration
public static implicit operator string (Mnemonic mnemonic)
Parameters
Returns
Implicit(String to Mnemonic)
Declaration
public static implicit operator Mnemonic(string mnemonicString)
Parameters
Type |
Name |
Description |
String |
mnemonicString |
|
Returns