Crates.io | qtum-address-rust |
lib.rs | qtum-address-rust |
version | 0.2.0 |
source | src |
created_at | 2020-12-23 16:25:03.096475 |
updated_at | 2023-04-30 23:35:16.319989 |
description | Rust lib for en/decoding address to Qtum/Ethereum format |
homepage | https://github.com/CipherDogs/qtum-address-rust |
repository | https://github.com/CipherDogs/qtum-address-rust |
max_upload_size | |
id | 326574 |
size | 42,334 |
Rust lib for en/decoding address to Qtum/Ethereum format
use qtum_address_rust::*;
fn main() {
let addr = "qTTH1Yr2eKCuDLqfxUyBLCAjmomQ8pyrBt";
let qtum = QtumAddress { prefix: 0x78 }; // testnet network prefix
let eth_addr = qtum.gethexaddress(addr).unwrap(); // 6c89a1a6ca2ae7c00b248bb2832d6f480f27da68
let qtum_addr = qtum.fromhexaddress(ð_addr).unwrap(); // qTTH1Yr2eKCuDLqfxUyBLCAjmomQ8pyrBt
}