Search Results for

    Show / Hide Table of Contents

    Struct Mnemonic

    Byte struct representing a private key encoded with Length words.

    Namespace: Algorand.Unity
    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
    Type Description
    Int32

    ChecksumIndex

    Index of the word used for the checksum.

    Declaration
    public const int ChecksumIndex = 24
    Field Value
    Type Description
    Int32

    Length

    Number of words contained in the mnemonic.

    Declaration
    public const int Length = 25
    Field Value
    Type Description
    Int32

    SizeBytes

    Size of Mnemonic in bytes.

    Declaration
    public const int SizeBytes = 50
    Field Value
    Type Description
    Int32

    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
    Type Name Description
    Mnemonic other
    Returns
    Type Description
    Boolean

    FromKey(PrivateKey)

    Declaration
    public static Mnemonic FromKey(PrivateKey key)
    Parameters
    Type Name Description
    PrivateKey key
    Returns
    Type Description
    Mnemonic

    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()

    Get the PrivateKey from this mnemonic encodes.

    Declaration
    public PrivateKey ToPrivateKey()
    Returns
    Type Description
    PrivateKey

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    ValueType.ToString()

    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
    Type Description
    Mnemonic.ParseError

    A ParseError if the mnemonic string could not be parsed.

    Operators

    Implicit(Mnemonic to String)

    Declaration
    public static implicit operator string (Mnemonic mnemonic)
    Parameters
    Type Name Description
    Mnemonic mnemonic
    Returns
    Type Description
    String

    Implicit(String to Mnemonic)

    Declaration
    public static implicit operator Mnemonic(string mnemonicString)
    Parameters
    Type Name Description
    String mnemonicString
    Returns
    Type Description
    Mnemonic
    ☀
    ☾
    In This Article
    Back to top
    Generated by DocFX
    ☀
    ☾