MnemonicCode

class MnemonicCode(val chars: CharArray, val languageCode: String = DEFAULT_LANGUAGE_CODE) : Closeable, Iterable<String>

Constructors

Link copied to clipboard
constructor(phrase: String, languageCode: String = DEFAULT_LANGUAGE_CODE)
constructor(entropy: ByteArray, languageCode: String = DEFAULT_LANGUAGE_CODE)
constructor(wordCount: Mnemonics.WordCount, languageCode: String = DEFAULT_LANGUAGE_CODE)
constructor(chars: CharArray, languageCode: String = DEFAULT_LANGUAGE_CODE)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val wordCount: <Error class: unknown class>
Link copied to clipboard

Converts the chars array into a list of CharArrays for each word. This library does not use this value but it exposes it as a convenience. In most cases, just working with the chars can be enough.

Functions

Link copied to clipboard
fun clear(): <Error class: unknown class>
Link copied to clipboard
open override fun close(): <Error class: unknown class>
Link copied to clipboard
fun isEmpty(): <Error class: unknown class>
Link copied to clipboard
open operator override fun iterator(): Iterator<String>
Link copied to clipboard

Get the original entropy that was used to create this MnemonicCode. This call will fail if the words have an invalid length or checksum.

Link copied to clipboard
fun Mnemonics.MnemonicCode.toSeed(passphrase: CharArray = charArrayOf(), validate: Boolean = true): ByteArray

Given a mnemonic, create a seed per BIP-0039.

Link copied to clipboard
fun validate()
Link copied to clipboard

Convenience method for validating the checksum of this MnemonicCode. Since validation requires deriving the original entropy, this function is the same as calling toEntropy.