Struct kaspa_bip32::Mnemonic
source · pub struct Mnemonic { /* private fields */ }
Expand description
BIP39 mnemonic phrases: sequences of words representing cryptographic keys.
Implementations§
source§impl Mnemonic
impl Mnemonic
pub fn constructor( phrase: String, language: Option<Language> ) -> Result<Mnemonic>
pub fn get_entropy(&self) -> String
pub fn set_entropy(&mut self, entropy: String)
pub fn create_random_js(word_count: JsValue) -> Result<Mnemonic>
pub fn phrase_string(&self) -> String
pub fn set_phrase(&mut self, phrase: &str)
pub fn create_seed(&self, password: Option<String>) -> String
source§impl Mnemonic
impl Mnemonic
pub fn random(word_count: WordCount, language: Language) -> Result<Mnemonic>
sourcepub fn random_impl(
word_count: WordCount,
rng: impl RngCore + CryptoRng,
language: Language
) -> Result<Self>
pub fn random_impl( word_count: WordCount, rng: impl RngCore + CryptoRng, language: Language ) -> Result<Self>
Create a random BIP39 mnemonic phrase.
sourcepub fn from_entropy(entropy: Vec<u8>, language: Language) -> Result<Self>
pub fn from_entropy(entropy: Vec<u8>, language: Language) -> Result<Self>
Create a new BIP39 mnemonic phrase from the given entropy
sourcepub fn new<S>(phrase: S, language: Language) -> Result<Self>
pub fn new<S>(phrase: S, language: Language) -> Result<Self>
Create a new BIP39 mnemonic phrase from the given string.
The phrase supplied will be checked for word length and validated according to the checksum specified in BIP0039.
To use the default language, English, (the only one supported by this
library and also the only one standardized for BIP39) you can supply
Default::default()
as the language.
Trait Implementations§
source§impl FromWasmAbi for Mnemonic
impl FromWasmAbi for Mnemonic
source§impl IntoWasmAbi for Mnemonic
impl IntoWasmAbi for Mnemonic
source§impl LongRefFromWasmAbi for Mnemonic
impl LongRefFromWasmAbi for Mnemonic
source§impl OptionFromWasmAbi for Mnemonic
impl OptionFromWasmAbi for Mnemonic
source§impl OptionIntoWasmAbi for Mnemonic
impl OptionIntoWasmAbi for Mnemonic
source§impl RefFromWasmAbi for Mnemonic
impl RefFromWasmAbi for Mnemonic
source§impl RefMutFromWasmAbi for Mnemonic
impl RefMutFromWasmAbi for Mnemonic
Auto Trait Implementations§
impl RefUnwindSafe for Mnemonic
impl Send for Mnemonic
impl Sync for Mnemonic
impl Unpin for Mnemonic
impl UnwindSafe for Mnemonic
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.