加密
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
445 B

3 years ago
  1. package crypter
  2. import (
  3. "fmt"
  4. "testing"
  5. )
  6. func Test_AuthCodeDec(t *testing.T) {
  7. str := "18175"
  8. key := "1509930887"
  9. isencode := true
  10. ret := AuthCode(str, key, isencode)
  11. fmt.Println(str, "加密结果 ret:", ret)
  12. }
  13. func Test_AuthCodeEnc(t *testing.T) {
  14. str := "1fa9Vsp7e91Pg9z8xorzO55lSbLcHZbNt9z10K8d7TEZZg"
  15. key := "1509930887"
  16. isencode := false
  17. ret := AuthCode(str, key, isencode)
  18. fmt.Println(str, "解密结果 ret:", ret)
  19. }