neo-go icon indicating copy to clipboard operation
neo-go copied to clipboard

Compressed stringer for public keys

Open roman-khimov opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe.

I'm always frustrated when I realize people have to do hex.EncodeToString(key.Bytes()) to get a string representation of the key in compressed form. They have https://pkg.go.dev/github.com/nspcc-dev/neo-go/pkg/crypto/keys#NewPublicKeyFromString to go the other way around, but they can't easily create this string.

Describe the solution you'd like

Some additional method to have a compressed hex string of the public key.

Describe alternatives you've considered

String() method returns uncompressed key and likely can't be changed at this point.

roman-khimov avatar Dec 15 '23 09:12 roman-khimov