flow-go-sdk
flow-go-sdk copied to clipboard
Consistent parsing hex values
It would be helpful if all hex values passed to parsing functions would handle 0x
prefix.
Currently flow.HexToAddress()
handles 0x
prefix.
Functions that currently don't:
-
flow.HexToID()
-
crypto.DecodePublicKeyHex()
(not sure if it makes sense to handle prefix in this one)
IMO IDs and public keys shouldn't be prefixed with 0x
. But maybe these functions should be tolerant of the prefix?
Feel free to close this it was just something I encountered when using SDK in CLI and I had to solve it by sanitizing input and removing prefix (similar to the problem with addresses being prefixed). Generally speaking 0x prefix denotes hex representation and I'm afraid it's really chaotic how IDs are represented in crypto, sometimes with 0x prefixes sometimes without.