1Panel/backend/utils/encrypt/encrypt_test.go

27 lines
425 B
Go
Raw Normal View History

2022-08-16 23:30:23 +08:00
package encrypt
import (
"fmt"
"testing"
"github.com/1Panel-dev/1Panel/backend/init/viper"
2022-08-16 23:30:23 +08:00
)
func TestStringEncrypt(t *testing.T) {
viper.Init()
p, err := StringEncrypt("1Panel@2022")
2022-08-16 23:30:23 +08:00
if err != nil {
t.Fatal(err)
}
fmt.Println(p)
}
func TestStringDecrypt(t *testing.T) {
viper.Init()
p, err := StringDecrypt("dXn5bVtea+KVLDrLJlpnPIJNfW8TAMmqX1QNMdSGp88=")
2022-08-16 23:30:23 +08:00
if err != nil {
t.Fatal(err)
}
fmt.Println(p)
}