crypto.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:two1-python 作者: 21dotco 项目源码 文件源码
def address(self, compressed=True, testnet=False):
        """ Address property that returns the Base58Check
        encoded version of the HASH160.

        Args:
            compressed (bool): Whether or not the compressed key should
               be used.
            testnet (bool): Whether or not the key is intended for testnet
               usage. False indicates mainnet usage.

        Returns:
            bytes: Base58Check encoded string
        """
        # Put the version byte in front, 0x00 for Mainnet, 0x6F for testnet
        version = bytes([self.TESTNET_VERSION]) if testnet else bytes([self.MAINNET_VERSION])
        return base58.b58encode_check(version + self.hash160(compressed))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号