gitee.com/quant1x/gox@v1.21.2/encoding/base64/base64_test.go (about) 1 package base64 2 3 import ( 4 "fmt" 5 "testing" 6 ) 7 8 func TestBase64GetEncoder(t *testing.T) { 9 s := Base64GetEncoder() 10 fmt.Println(s) 11 } 12 13 func TestBase64(t *testing.T) { 14 s := Base64GetEncoder() 15 base64 := NewBase64(s) 16 ev := base64.Encode("123") 17 fmt.Println(ev) 18 dv, err := base64.Decode(ev) 19 fmt.Println(dv, err) 20 } 21 22 func TestPseudoBase64(t *testing.T) { 23 base64 := NewPseudoBase64(1) 24 ev := base64.Encode("123") 25 fmt.Println(ev) 26 dv, err := base64.Decode(ev) 27 fmt.Println(dv, err) 28 }