Created
May 20, 2016 09:07
-
-
Save johnsonz/cc815e72d4d0fa25808b1accc3027542 to your computer and use it in GitHub Desktop.
go base64 编码和解码
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
func Base64Encode(b []byte) string { | |
return base64.StdEncoding.EncodeToString(b) | |
} | |
func Base64Decode(b []byte) ([]byte, error) { | |
return base64.StdEncoding.DecodeString(string(b)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment