| 1 | import 'dart:typed_data'; |
| 2 | |
| 3 | import 'package:bip39/bip39.dart' as bip39; |
| 4 | |
| 5 | class MnemonicBip39 { |
| 6 | /// Generate bip39 mnemonic |
| 7 | static String generate({int strength = 128}) => bip39.generateMnemonic(strength: strength); |
| 8 | |
| 9 | /// Create root seed from mnemonic |
| 10 | static Uint8List toSeed(String mnemonic, {String? passphrase}) => |
| 11 | bip39.mnemonicToSeed(mnemonic, passphrase: passphrase ?? ''); |
| 12 | } |