mirror of https://github.com/1Panel-dev/1Panel
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.
27 lines
425 B
27 lines
425 B
package encrypt
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/init/viper"
|
|
)
|
|
|
|
func TestStringEncrypt(t *testing.T) {
|
|
viper.Init()
|
|
p, err := StringEncrypt("1Panel@2022")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
fmt.Println(p)
|
|
}
|
|
|
|
func TestStringDecrypt(t *testing.T) {
|
|
viper.Init()
|
|
p, err := StringDecrypt("dXn5bVtea+KVLDrLJlpnPIJNfW8TAMmqX1QNMdSGp88=")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
fmt.Println(p)
|
|
}
|