condition.py 文件源码

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

项目:cryptoconditions 作者: bigchaindb 项目源码 文件源码
def serialize_binary(self):
        """
        Serialize condition to a buffer.

        Encodes the condition as a string of bytes. This is used internally for
        encoding subconditions, but can also be used to passing around conditions
        in a binary protocol for instance.

        CONDITION =
            VARUINT TYPE_BITMASK
            VARBYTES HASH
            VARUINT MAX_COST

        Return:
            Serialized condition
        """
        asn1_dict = self.to_asn1_dict()
        asn1_condition = nat_decode(asn1_dict, asn1Spec=Asn1Condition())
        binary_condition = der_encode(asn1_condition)
        return binary_condition
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号