Files
go-i2p/lib/common/base64/base64.go
2016-02-06 02:06:27 -08:00

19 lines
384 B
Go

//
// base64 encoding using I2P's alphabet
//
package base64
import (
b64 "encoding/base64"
)
var I2PEncoding *b64.Encoding = b64.NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-~")
//
// Return a go string of the I2P base64
// encoding of the provided byte slice
//
func EncodeToString(data []byte) string {
return I2PEncoding.EncodeToString(data)
}