parent
14611a30b9
commit
06d2bf229e
@ -1,5 +1,5 @@
|
|||||||
package go_library
|
package go_library
|
||||||
|
|
||||||
func Version() string {
|
func Version() string {
|
||||||
return "v1.0.31"
|
return "v1.0.32"
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
package go_library
|
package go_library
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"log"
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestVersion(t *testing.T) {
|
func TestVersion(t *testing.T) {
|
||||||
fmt.Println(Version())
|
t.Log(Version())
|
||||||
log.Println(Version())
|
|
||||||
}
|
}
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
apiclient_cert.pem
|
|
||||||
apiclient_key.pem
|
|
||||||
app_test.go
|
|
@ -1,4 +1,4 @@
|
|||||||
package aes
|
package goaes
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
@ -0,0 +1,17 @@
|
|||||||
|
package gobase64
|
||||||
|
|
||||||
|
import "encoding/base64"
|
||||||
|
|
||||||
|
// Encode base64编码
|
||||||
|
func Encode(input string) string {
|
||||||
|
return base64.StdEncoding.EncodeToString([]byte(input))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Decode base64解码
|
||||||
|
func Decode(input string) string {
|
||||||
|
decodeString, err := base64.StdEncoding.DecodeString(input)
|
||||||
|
if err != nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return string(decodeString)
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package gobase64
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestEncode(t *testing.T) {
|
||||||
|
t.Log(Encode("广东茂名"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestDecode(t *testing.T) {
|
||||||
|
t.Log(Decode(Encode("广东茂名")))
|
||||||
|
}
|
Loading…
Reference in new issue