iov-one / iov-core

Client library for secure key management and multi-blockchain communication
https://iov-one.github.io/iov-core-docs/
Apache License 2.0
198 stars 18 forks source link

Pull out free functions fromHex, toHex #1431

Closed webmaster128 closed 4 years ago

webmaster128 commented 4 years ago

Using static class members instead of free functions was a mistake from the early days. The idea was to use the class for namespacing, but we never ran into any kind of naming collision and can just import fromHex/toHex directly.

This makes using them much simpler, especially avoiding all those destructions like const { toHex } = Encoding;

If this is good, I can do the same for the remaining functions in Encoding