Skip to content

Commit

Permalink
Add isValidSeed
Browse files Browse the repository at this point in the history
  • Loading branch information
konstantinullrich committed Sep 28, 2023
1 parent d33791b commit 0759e0c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/src/polyseed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ class Polyseed {

late PolyseedData _data;

/// Check if a seed is a valid Polyseed
static bool isValidSeed(String phrase) {
if (!PolyseedLang.isValidPhrase(phrase)) return false;
final lang = PolyseedLang.getByPhrase(phrase);

return phrase.split(lang.separator).length == numberOfWords;
}

/// Create a random [Polyseed]
Polyseed.create({int features = 0}) {
// check features
Expand Down

0 comments on commit 0759e0c

Please sign in to comment.