diff --git a/src/mnemonic/mnemonic.py b/src/mnemonic/mnemonic.py index 81a852c..9457f9d 100644 --- a/src/mnemonic/mnemonic.py +++ b/src/mnemonic/mnemonic.py @@ -128,7 +128,7 @@ def generate(self, strength: int = 128) -> str: # Adapted from def to_entropy(self, words: Union[List[str], str]) -> bytearray: if not isinstance(words, list): - words = words.split(self.delimiter) + words = words.split(" ") if len(words) not in [12, 15, 18, 21, 24]: raise ValueError( "Number of words must be one of the following: [12, 15, 18, 21, 24], but it is not (%d)." @@ -186,7 +186,7 @@ def to_mnemonic(self, data: bytes) -> str: return self.delimiter.join(result) def check(self, mnemonic: str) -> bool: - mnemonic_list = self.normalize_string(mnemonic).split(self.delimiter) + mnemonic_list = self.normalize_string(mnemonic).split(" ") # list of valid mnemonic lengths if len(mnemonic_list) not in [12, 15, 18, 21, 24]: return False @@ -217,7 +217,7 @@ def expand_word(self, prefix: str) -> str: return prefix def expand(self, mnemonic: str) -> str: - return " ".join(map(self.expand_word, mnemonic.split(self.delimiter))) + return " ".join(map(self.expand_word, mnemonic.split(" "))) @classmethod def to_seed(cls, mnemonic: str, passphrase: str = "") -> bytes: