Documentation ¶
Overview ¶
转换基于比特币地址规则的币种 使用此规则的币种有:BTC、BCH、LTC、ZEC、USDT、 BTY
对各个币种进行注册
Index ¶
- type BtcBaseTransformer
- func (t BtcBaseTransformer) Base58ToByte(str string) (bin []byte, err error)
- func (t BtcBaseTransformer) ByteToBase58(bin []byte) (str string)
- func (t BtcBaseTransformer) PrivKeyToPub(priv []byte) (pub []byte, err error)
- func (t BtcBaseTransformer) PubKeyToAddress(pub []byte) (addr string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BtcBaseTransformer ¶
type BtcBaseTransformer struct {
// contains filtered or unexported fields
}
func (BtcBaseTransformer) Base58ToByte ¶
func (t BtcBaseTransformer) Base58ToByte(str string) (bin []byte, err error)
base58转字节形式
func (BtcBaseTransformer) ByteToBase58 ¶
func (t BtcBaseTransformer) ByteToBase58(bin []byte) (str string)
字节形式转base58编码
func (BtcBaseTransformer) PrivKeyToPub ¶
func (t BtcBaseTransformer) PrivKeyToPub(priv []byte) (pub []byte, err error)
TODO: 根据私钥类型进行判断,选择输出压缩或非压缩公钥 32字节私钥生成压缩格式公钥
func (BtcBaseTransformer) PubKeyToAddress ¶
func (t BtcBaseTransformer) PubKeyToAddress(pub []byte) (addr string, err error)
传入压缩或非压缩形式的公钥,生成base58编码的地址 (压缩和非压缩形式的公钥生成的地址是不同的,但都是合法的)
Click to show internal directories.
Click to hide internal directories.