package test import ( "git.hilo.cn/hilo-common/utils" "testing" ) type UserTest struct { Name string `json:"name"` Age int `json:"age"` } func TestEncryptionData(t *testing.T) { u := UserTest{ Name: "jiebin", Age: 10, } e := utils.EncryptionData(u, []byte("hilo!@#$%^&*()_+")) println(e) } func TestDecryptionData(t *testing.T) { str := "owkzMQAk96rSRCg8Rh/I4eb4YClUrypOiR072ftTDICqyH+fB+yvOyTmVgcGaKKzl4GFaU2QA/c4rnPgqIZJfhhQ18TiyUauk/yT8btj4wPlvoz8MTwogB4d+vxl/9dVrmo/zqC9mJ+dKaSYRhKUNz3TcIwIaSm5dkGRbk0WDH45GNRpHCAjBAn7eSOat4tfiSMguhXQunGjepVQZKbIDv/ljPANVJNyTR/5Oo3Dn1b3Tho4Bc7xJQuhy1SDVm4Dvn/UxdEPMFM/7TE325Lkazf65u3Sd+znVdPh+LM+WYEcZHXxEc4S++OPYgwD4iOmkN6Y/4DDwaCr5FtwuE+5bSgpVHkeLMq2mkMQRfMhkLUdWyJcQNjufi6N9S1WMJ9DpEocdFl1xkav2zyjCaixkcLrJMh0l6o9guIQ4bICNyE039N3MhS89c2v802xROKDynNUWRtcqaONaeGRxYoMeqN7zw7eDY/2ADxV5CtA5KYbgq4o3bXaM/7vj0rn1SKwRkCAoFjxBEcPmM6wHj6d6uWss6UGw1dPPs7377iTyenEBv9MY6byd61pX8JaGYt+9kfiCIJ2apQpIemxeFPJ+qoOl7K7olsmlK2eiaGzC+42b4sg0D6Z0gssKXqT3fNSBShAHsc+Q4k0qwf4UGFuxZ+fLXQZsUVYrIRUqtdvPATw6LlcD0p7s53FkSEuYfPAMW0JHz3J47SPPn0IccHShYaeRG5ROinrWDYsZSl3WQsgF1cMBH44wryc+MS89ES3yZyviJ+romhbXNcRrgI/LNAS6EnaSKs5Q6SdMdO7rFAZVBF3Dk0I9CNFvXTr3zIt+tni+hE3AgM91K9jaLHhZTW1/fQO7ESz912w1cDaIIhLVr3kkDjDkT64Ov57fJPptabthfU1x0ebG8Jf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eSkn1WrY/fFXj+w5YPupgp2Vf/bFXTZ/PsINc0uGluDF22YJ+LZlQYHS5wICzyn1XLX8DWGS2yvcSHZCcMWaOTwLWMGbZXDFZsMqBQQ/4ui+G51Kng996HjjznQO0qzlRGzDay2dhNgadK8CrxGbugJWpe/TdFX3JkVX580Vy3bFXJz+ZEinXcYx7A/6unTUxL0yQn5SKyk6rlLKeTZj0S/febteKkzxtn1E7/sZl83R77wWXQFVXm31cF8qXoovtkoAUv3AQSWSbmDasG8C1+g2PYIj+hm88vQQzkx5J8XQHwRPJofVrxYQCjgI+wiZslLwRMMQw" //str = "xzzfwpb6ciRMyLbIajjy+trSsKysmQqCqR29vldutp4=" e, err := utils.Decryption(str, []byte("hilo!@#$%^&*()_+")) t.Logf("%v-%v", e, err) }