test.go 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. package main
  2. import (
  3. "encoding/hex"
  4. "fmt"
  5. "gitlab.bianjie.ai/avata/utils/commons/aes"
  6. )
  7. func main() {
  8. name := "udajdgad"
  9. fmt.Println(hex.EncodeToString([]byte(name)))
  10. fmt.Println(len("1ftKJbnT1TpK6Vp2JBvgVuDd5Tk5jednjGuyEXlx5VoQ57iddStEb/YboNs="))
  11. key := "z2T2u0Q7i007G0R7G1F420L0u7s7v0e"
  12. apiSecret, _ := aes.Encode(key, "Console_Projects_Secrets")
  13. fmt.Println(apiSecret, len(key), len(apiSecret))
  14. key = "z2T2u0Q7i007G0R7G1F420L0u7s7v0e2"
  15. apiSecret, _ = aes.Encode(key, "Console_Projects_Secrets")
  16. fmt.Println(apiSecret, len(key), len(apiSecret))
  17. key = "z2T2u0Q7i007G0R7G1F420L0u7s7v0"
  18. apiSecret, _ = aes.Encode(key, "Console_Projects_Secrets")
  19. fmt.Println(apiSecret, len(key), len(apiSecret))
  20. key = "z2T2u0Q7i007G0R7G1F420L0u7s7v"
  21. apiSecret, _ = aes.Encode(key, "Console_Projects_Secrets")
  22. fmt.Println(apiSecret, len(key), len(apiSecret))
  23. key = "z2T2u0Q7i007G0R7G1F420L0u7s7"
  24. apiSecret, _ = aes.Encode(key, "Console_Projects_Secrets")
  25. fmt.Println(apiSecret, len(key), len(apiSecret))
  26. key = "z2T2u0Q7i007G0R7G1F420L0u7s"
  27. apiSecret, _ = aes.Encode(key, "Console_Projects_Secrets")
  28. fmt.Println(apiSecret, len(key), len(apiSecret))
  29. }