package utils

import (
	"fmt"
	"testing"
	"time"
)

func TestGenerateAdminHashedPassword(t *testing.T) {
	chatMd5 := MD5("chat2025")
	chatHash, chatErr := GenerateAdminHashedPassword(chatMd5)
	t.Log("chat2025 MD5:", chatMd5, "Hash:", chatHash, "Err:", chatErr)

	pwdMd5 := MD5("123456")
	pwdHash, pwdErr := GenerateAdminHashedPassword(pwdMd5)
	t.Log("123456 MD5:", pwdMd5, "Hash:", pwdHash, "Err:", pwdErr)
}

func TestXorEncrypt(t *testing.T) {
	t.Log(XorEncrypt(fmt.Sprintf("%s%d", "13800000001", time.Now().Local().Unix()), "999999"))
}

func TestXorDecrypt(t *testing.T) {
	t.Log(XorDecrypt("CAoBCQkJCQkJCQgIDgwKAQwKCg8B", "999999"))
}
