encdec.go 493 B

1234567891011121314151617181920212223
  1. package main
  2. import (
  3. "encoding/base64"
  4. "fmt"
  5. "git.daimon.cc/daimon99/hsyc-utils/pkg/utils"
  6. )
  7. func main() {
  8. utils.SetKey("12345678901234567890123456789012")
  9. result, err := utils.Encode([]string{"n1", "n2"})
  10. if err != nil {
  11. fmt.Println(err)
  12. }
  13. fmt.Println(result)
  14. decoded, _ := utils.Decode(result)
  15. fmt.Printf("{%v}", decoded)
  16. utils.CustomBase64Encode([]byte("1234561111"))
  17. result = base64.StdEncoding.EncodeToString([]byte("123456290asdfjba测试sdf"))
  18. fmt.Println(result)
  19. }