celestiaorg / nmt

Namespaced Merkle Tree
Apache License 2.0
112 stars 39 forks source link

Pretty print namespace.ID #200

Closed walldiss closed 1 year ago

walldiss commented 1 year ago

In celestia-node we rely a lot on nmt namespace.ID type and want to log it in multiple places in human readable manner(hex representation). Current implementation of String() method on namespace.ID does direct convertion to string type, and makes it impossible to read. I wonder if other users of nmt pkg would benefit from ability to pretty print namespace.ID. If so there could be 2 options:

rootulp commented 1 year ago

add extra method HexString.

Sounds like a good idea to me!