NodeID has many different output formats and conversion functions which are scattered throughout the code. It would be great if we could isolate all the formats and conversions to a single API with tests that enforce consistency between the various formats. The idea is that node.ID could be a consistent, easy-to-read package with minimal dependences for all bit and path manipulation purposes.
Proposal:
- new
node package to contain node.ID.
- Should the package be named
nodeid?
- Make
ID's members private if possible to enforce new API use.
- Use
node.ID in place of big.Int
- Shorten
NewNodeIDFrom* functions to NewFrom
- Use
ID in place of Prefix and Suffix since all three use the format "Path + depth"
Other suggestions?
NodeIDhas many different output formats and conversion functions which are scattered throughout the code. It would be great if we could isolate all the formats and conversions to a single API with tests that enforce consistency between the various formats. The idea is thatnode.IDcould be a consistent, easy-to-read package with minimal dependences for all bit and path manipulation purposes.Proposal:
nodepackage to containnode.ID.nodeid?ID's members private if possible to enforce new API use.node.IDin place ofbig.IntNewNodeIDFrom*functions toNewFromIDin place ofPrefixandSuffixsince all three use the format "Path + depth"Other suggestions?