encoding comments

This commit is contained in:
Hayden Parker
2016-02-06 02:06:27 -08:00
parent 2b64fcaf33
commit a5c6cb8041
2 changed files with 14 additions and 12 deletions

View File

@ -1,5 +1,5 @@
//
// base64 encoding with i2p's alphabet
// base64 encoding using I2P's alphabet
//
package base64
@ -7,11 +7,12 @@ import (
b64 "encoding/base64"
)
// i2p base64 encoding
var I2PEncoding *b64.Encoding = b64.NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-~")
// wrapper arround encoding for encoding to string
func EncodeToString(data []byte) (str string) {
str = I2PEncoding.EncodeToString(data)
return
//
// Return a go string of the I2P base64
// encoding of the provided byte slice
//
func EncodeToString(data []byte) string {
return I2PEncoding.EncodeToString(data)
}