main_test.go 690 B

12345678910111213141516171819202122232425262728293031
  1. package yu_base64
  2. import (
  3. "encoding/base64"
  4. "fmt"
  5. yu_rand "gogs.qqck.cn/s/tools/rand"
  6. "testing"
  7. )
  8. var ddd = []byte("adasdasdawddqdqw8d7qw685as78d78qwd'强无敌群无多群无")
  9. var enenen = base64.StdEncoding.EncodeToString(ddd)
  10. func TestName(t *testing.T) {
  11. fmt.Println(Std.Encode2S(yu_rand.Bytes(100)))
  12. fmt.Println(base64.StdEncoding.EncodeToString(ddd))
  13. fmt.Println(Std.Encode2S(ddd))
  14. fmt.Println(base64.StdEncoding.DecodeString(enenen))
  15. fmt.Println(Std.DecodeS(enenen))
  16. }
  17. func BenchmarkName(b *testing.B) {
  18. for i := 0; i < b.N; i++ {
  19. base64.StdEncoding.EncodeToString(ddd)
  20. }
  21. }
  22. func BenchmarkName2(b *testing.B) {
  23. for i := 0; i < b.N; i++ {
  24. Std.Encode2S(ddd)
  25. }
  26. }