再次尝试集成节点订阅地址错误的问题
Some checks failed
build / build (api, amd64, linux) (push) Failing after -51s
build / build (api, arm64, linux) (push) Failing after -51s
build / build (api.exe, amd64, windows) (push) Failing after -51s

This commit is contained in:
CN-JS-HuiBai
2026-04-18 00:18:52 +08:00
parent cafab67dcc
commit d341138c8a

View File

@@ -377,7 +377,8 @@ func serverKey(createdAt *time.Time, size int) string {
// Match XBoard's Helper::getServerKey(created_at, size): // Match XBoard's Helper::getServerKey(created_at, size):
// base64_encode(substr(md5($timestamp), 0, size)) // base64_encode(substr(md5($timestamp), 0, size))
sum := md5.Sum([]byte(createdAt.Format("2006-01-02 15:04:05"))) // In XBoard, created_at is cast to a Unix timestamp before md5().
sum := md5.Sum([]byte(strconv.FormatInt(createdAt.Unix(), 10)))
hex := fmt.Sprintf("%x", sum) hex := fmt.Sprintf("%x", sum)
if size > len(hex) { if size > len(hex) {
size = len(hex) size = len(hex)