crypt API changes
This commit is contained in:
@@ -153,7 +153,7 @@ func PutIdentityCookie(w http.ResponseWriter, r *http.Request, identity *auth.Id
|
||||
|
||||
httpCookie := &http.Cookie{
|
||||
Name: config.IDENTITY_COOKIE_NAME,
|
||||
Value: security.EncodeBase58(string(identityData)),
|
||||
Value: security.EncodeBase58(identityData),
|
||||
HttpOnly: true,
|
||||
Secure: r.URL.Scheme == "https",
|
||||
Path: "/",
|
||||
|
||||
@@ -62,7 +62,7 @@ func PutSessionCookie(w http.ResponseWriter, r *http.Request, session map[string
|
||||
|
||||
httpCookie := &http.Cookie{
|
||||
Name: config.SESSION_COOKIE_NAME,
|
||||
Value: security.EncodeBase58(string(sessionData)),
|
||||
Value: security.EncodeBase58(sessionData),
|
||||
HttpOnly: true,
|
||||
Secure: r.URL.Scheme == "https",
|
||||
Path: "/",
|
||||
|
||||
@@ -24,21 +24,21 @@ import (
|
||||
// Encoding Wrappers
|
||||
////////////////////////////////
|
||||
|
||||
func EncodeBase64(in string) string {
|
||||
return base64.StdEncoding.EncodeToString([]byte(in))
|
||||
func EncodeBase64(in []byte) string {
|
||||
return base64.StdEncoding.EncodeToString(in)
|
||||
}
|
||||
|
||||
func DecodeBase64(in string) string {
|
||||
func DecodeBase64(in string) []byte {
|
||||
out, _ := base64.RawStdEncoding.DecodeString(in)
|
||||
return string(out)
|
||||
return out
|
||||
}
|
||||
|
||||
func EncodeBase58(in string) string {
|
||||
return base58.Encode([]byte(in))
|
||||
func EncodeBase58(in []byte) string {
|
||||
return base58.Encode(in)
|
||||
}
|
||||
|
||||
func DecodeBase58(in string) string {
|
||||
return string(base58.Decode(in))
|
||||
func DecodeBase58(in string) []byte {
|
||||
return base58.Decode(in)
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user