再次尝试集成节点订阅地址错误的问题
This commit is contained in:
@@ -377,7 +377,8 @@ func serverKey(createdAt *time.Time, size int) string {
|
||||
|
||||
// Match XBoard's Helper::getServerKey(created_at, 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)
|
||||
if size > len(hex) {
|
||||
size = len(hex)
|
||||
|
||||
Reference in New Issue
Block a user