Trait crypto_addr::WIF
source · pub trait WIF {
// Required method
fn wif(&self, opts: WIFFormat) -> Result<String, Error>;
}Expand description
Encode a private key using WIF format
Usage
WIFs are generated using WIF::wif
use crypto_addr::{WIF, WIFFormat};
let sigkey = b"\xeb\x904)e2\x8a\xe1\xe0\x8e\xfd\xeb+x\xbc2\xd0&/\x04-\xe8\xab\xcd]0\xd6\
\x07t\x9c\xb3\xaa";
let wif_string = sigkey.wif(WIFFormat::Dogecoin).expect("Could not serialize sigkey data");
assert_eq!(wif_string, "QWWXnSvkQ948FxJfGj4hBtkWjTsrHZYjVpMRMBwqogP9NWvJUzFm");