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