fn digest(&self) -> Option<ADDigest> {
        let this = self.get_state();
        assert!(this.tree.height < 256);
        // rootNodeHeight should never be more than 255, so the toByte conversion is safe (though it may cause an incorrect
        // sign on the signed byte if rootHeight>127, but we handle that case correctly on decoding the byte back to int in the
        // verifier, by adding 256 if it's negative).
        // The reason rootNodeHeight should never be more than 255 is that if height is more than 255,
        // then the AVL tree has at least  2^{255/1.4405} = 2^177 leaves, which is more than the number of atoms on planet Earth.
        if let Some(root) = &this.tree.root {
            let mut buf = BytesMut::new();
            buf.extend_from_slice(&this.tree.label(root));
            buf.put_u8(this.tree.height as u8);
            Some(buf.freeze())
        } else {
            None
        }
    }
///
/// The digest consists of the label of the root node followed by its height,
/// expressed as a single (unsigned) byte
///
The digest consists of the label of the root node followed by its height,
expressed as a single (unsigned) byte
The digest consists of the label of the root node followed by its height expressed as a single ( unsigned ) byte
fn digest(&self) -> Option<ADDigest> {
        let this = self.get_state();
        assert!(this.tree.height < 256);
        // rootNodeHeight should never be more than 255, so the toByte conversion is safe (though it may cause an incorrect
        // sign on the signed byte if rootHeight>127, but we handle that case correctly on decoding the byte back to int in the
        // verifier, by adding 256 if it's negative).
        // The reason rootNodeHeight should never be more than 255 is that if height is more than 255,
        // then the AVL tree has at least  2^{255/1.4405} = 2^177 leaves, which is more than the number of atoms on planet Earth.
        if let Some(root) = &this.tree.root {
            let mut buf = BytesMut::new();
            buf.extend_from_slice(&this.tree.label(root));
            buf.put_u8(this.tree.height as u8);
            Some(buf.freeze())
        } else {
            None
        }
    }
fn digest ( & self ) -> Option < ADDigest > { let this = self . get_state ( ) ; assert ! ( this tree height 256 ) ; // rootNodeHeight should never be more than 255, so the toByte conversion is safe (though it may cause an incorrect // sign on the signed byte if rootHeight>127, but we handle that case correctly on decoding the byte back to int in the // verifier, by adding 256 if it's negative). // The reason rootNodeHeight should never be more than 255 is that if height is more than 255, // then the AVL tree has at least  2^{255/1.4405} = 2^177 leaves, which is more than the number of atoms on planet Earth. if let Some ( root ) = & this . tree . root { let mut buf = BytesMut :: new ( ) ; buf . extend_from_slice ( & this . tree . label ( root ) ) ; buf . put_u8 ( this . tree . height as u8 ) ; Some ( buf . freeze ( ) ) } else { None } }
The digest consists of the label of the root node followed by its height,
expressed as a single (unsigned) byte
The digest consists of the label of the root node followed by its height expressed as a single ( unsigned ) byte
&self
&self