def __init__(self, phrase_or_hex="", wordlist="English"):
        """If user supplied a seed string to the class, break it down and determine
        if it's hexadecimal or mnemonic word string. Gather the values and store them.
        If no seed is passed, automatically generate a new one from local system randomness.

        :rtype: :class:`Seed <monero.seed.Seed>`
        """
        self.phrase = "" #13 or 25 word mnemonic word string
        self.hex = "" # hexadecimal

        self.word_list = wordlists.get_wordlist(wordlist)

        self._ed_pub_spend_key = None
        self._ed_pub_view_key = None

        if phrase_or_hex:
            seed_split = phrase_or_hex.split(" ")
            if len(seed_split) >= 24:
                # standard mnemonic
                self.phrase = phrase_or_hex
                if len(seed_split) == 25:
                    # with checksum
                    self._validate_checksum()
                self._decode_seed()
            elif len(seed_split) >= 12:
                # mymonero mnemonic
                self.phrase = phrase_or_hex
                if len(seed_split) == 13:
                    # with checksum
                    self._validate_checksum()
                self._decode_seed()
            elif len(seed_split) == 1:
                # single string, probably hex, but confirm
                if not len(phrase_or_hex) % 8 == 0:
                    raise ValueError("Not valid hexadecimal: {hex}".format(hex=phrase_or_hex))
                self.hex = phrase_or_hex
                self._encode_seed()
            else:
                raise ValueError("Not valid mnemonic phrase or hex: {arg}".format(arg=phrase_or_hex))
        else:
            self.hex = generate_hex()
            self._encode_seed()
def __init__ ( self , phrase_or_hex = "" , wordlist = "English" ) : self . phrase = "" self . hex = "" self . word_list = wordlists . get_wordlist ( wordlist ) self . _ed_pub_spend_key = None self . _ed_pub_view_key = None if phrase_or_hex : seed_split = phrase_or_hex . split ( " " ) if len ( seed_split ) >= 24 : self . phrase = phrase_or_hex if len ( seed_split ) == 25 : self . _validate_checksum ( ) self . _decode_seed ( ) elif len ( seed_split ) >= 12 : self . phrase = phrase_or_hex if len ( seed_split ) == 13 : self . _validate_checksum ( ) self . _decode_seed ( ) elif len ( seed_split ) == 1 : if not len ( phrase_or_hex ) % 8 == 0 : raise ValueError ( "Not valid hexadecimal: {hex}" . format ( hex = phrase_or_hex ) ) self . hex = phrase_or_hex self . _encode_seed ( ) else : raise ValueError ( "Not valid mnemonic phrase or hex: {arg}" . format ( arg = phrase_or_hex ) ) else : self . hex = generate_hex ( ) self . _encode_seed ( )
If user supplied a seed string to the class, break it down and determine
        if it's hexadecimal or mnemonic word string. Gather the values and store them.
        If no seed is passed, automatically generate a new one from local system randomness.

        :rtype: :class:`Seed <monero.seed.Seed>`