Skip to content

Conversation

@coreyphillips
Copy link

@coreyphillips coreyphillips commented Nov 11, 2025

This PR:

  • Adds WordCount enum to restrict word counts to valid BIP39 values (12, 15, 18, 21 & 24)
  • Updates generate(), generate_in(), and generate_in_with() to accept WordCount instead of usize
  • Updates usage in comments and tests accordingly
  • Closes Introduce enum WordCount #97
  • ⚠️ This is a breaking change
    • generate() now requires use of the WordCount enum for the word_count parameter.
    • Migration:
      // Before
      let m = Mnemonic::generate(24)?;
      
      // After
      let m = Mnemonic::generate(WordCount::Words24)?;

- Add WordCount enum to restrict word counts to valid BIP39 values (12, 15, 18, 21 & 24)
- Update generate(), generate_in(), and generate_in_with() to accept WordCount instead of usize
- Update usage in comments and tests accordingly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce enum WordCount

1 participant