#cash #bitcoin #bch

bch_addr

受 bchaddrjs 启发的 cash_addr 格式实现

1 个不稳定版本

0.1.0 2019 年 3 月 9 日

#9#bch

Download history 55/week @ 2024-03-11 43/week @ 2024-03-18 82/week @ 2024-03-25 71/week @ 2024-04-01 38/week @ 2024-04-08 131/week @ 2024-04-15 57/week @ 2024-04-22 5/week @ 2024-04-29 53/week @ 2024-05-06 28/week @ 2024-05-13 13/week @ 2024-05-20 12/week @ 2024-05-27 18/week @ 2024-06-03 14/week @ 2024-06-10 54/week @ 2024-06-17 26/week @ 2024-06-24

113 每月下载量
用于 cash_tx_builder

MIT 许可证

45KB
696

bch_addr

CircleCI codecov

bchaddrjs 启发的 cash_addr 格式实现。

用法

use bch_addr::Converter;
let converter = Converter::new();
let cash_addr = converter.to_cash_addr("1B9UNtBfkkpgt8kVbwLN9ktE62QKnMbDzR").unwrap();
assert_eq!(cash_addr, "bitcoincash:qph5kuz78czq00e3t85ugpgd7xmer5kr7c5f6jdpwk");

let legacy_addr = converter.to_legacy_addr(&cash_addr).unwrap();
assert_eq!(legacy_addr, "1B9UNtBfkkpgt8kVbwLN9ktE62QKnMbDzR");

lib.rs:

受 bchaddrjs 启发的 cash_addr 格式实现。

示例

use bch_addr::Converter;
let converter = Converter::new();
let cash_addr = converter.to_cash_addr("1B9UNtBfkkpgt8kVbwLN9ktE62QKnMbDzR").unwrap();
assert_eq!(cash_addr, "bitcoincash:qph5kuz78czq00e3t85ugpgd7xmer5kr7c5f6jdpwk");

let legacy_addr = converter.to_legacy_addr(&cash_addr).unwrap();
assert_eq!(legacy_addr, "1B9UNtBfkkpgt8kVbwLN9ktE62QKnMbDzR");

依赖项

~1MB
~18K SLoC