12345678910111213141516171819202122232425262728293031 |
- package yu_base64
- import (
- "encoding/base64"
- "fmt"
- yu_rand "gogs.qqck.cn/s/tools/rand"
- "testing"
- )
- var ddd = []byte("adasdasdawddqdqw8d7qw685as78d78qwd'强无敌群无多群无")
- var enenen = base64.StdEncoding.EncodeToString(ddd)
- func TestName(t *testing.T) {
- fmt.Println(Std.Encode2S(yu_rand.Bytes(100)))
- fmt.Println(base64.StdEncoding.EncodeToString(ddd))
- fmt.Println(Std.Encode2S(ddd))
- fmt.Println(base64.StdEncoding.DecodeString(enenen))
- fmt.Println(Std.DecodeS(enenen))
- }
- func BenchmarkName(b *testing.B) {
- for i := 0; i < b.N; i++ {
- base64.StdEncoding.EncodeToString(ddd)
- }
- }
- func BenchmarkName2(b *testing.B) {
- for i := 0; i < b.N; i++ {
- Std.Encode2S(ddd)
- }
- }
|