Mar-15-2020, 08:21 PM
Hello, my question is as follows:
Assume I have a list that contains mixed types. For instance
(maybe there's a better one, if yes please suggest)
However the libarary (as well as another one I've tried) requires the elements stored in the tree to be represented as bytes.
What is the best way to convert each element of mylist to byte representation?
Assume I have a list that contains mixed types. For instance
firstelement = [0,(a,b)] secondelement = [1,(c,d)] mylist = [firstelement,secondelement]where a,b,c,d are some objects
>>> type(a) <class '__main__.myObject'>I want to add the elements of mylist into a Merkle Tree. I searched and found the pymerkle library https://pymerkle.readthedocs.io/en/latest/index.html
(maybe there's a better one, if yes please suggest)
However the libarary (as well as another one I've tried) requires the elements stored in the tree to be represented as bytes.
What is the best way to convert each element of mylist to byte representation?