Created
October 10, 2018 17:28
-
-
Save zjshen14/020208400148bc80fcbee1a25e216c58 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const PublicKeyLength = 72 | |
type PublicKey [PublicKeyLength]byte | |
func PublicKeyFromHex(hex string) PublicKey [72]byte { ... } | |
func PublicKeyFromBytes(bytes []byte) PublicKey [72]byte { | |
var pk PublicKey | |
if len(bytes) != PublicKeyLength { | |
return pk | |
} | |
cp(pk[:], bytes) | |
return pk | |
} | |
func (pk PublicKey) Hex() string { ... } | |
func (pk PublicKey) Bytes() string { return pk[:] } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment