Prathamesh Musale
a36063aba6
Reviewed-on: deep-stack/laconic2d#3 Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
22 lines
340 B
Go
22 lines
340 B
Go
package utils
|
|
|
|
import "github.com/cosmos/go-bip39"
|
|
|
|
const (
|
|
mnemonicEntropySize = 256
|
|
)
|
|
|
|
func GenerateMnemonic() (string, error) {
|
|
entropySeed, err := bip39.NewEntropy(mnemonicEntropySize)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
|
|
mnemonic, err := bip39.NewMnemonic(entropySeed)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
|
|
return mnemonic, nil
|
|
}
|