service/library/melody/util.go

13 lines
193 B
Go
Raw Normal View History

2024-10-12 16:28:53 +08:00
package melody
import (
"crypto/md5"
"fmt"
uuid "github.com/hashicorp/go-uuid"
)
func GenMsgId() string {
s, _ := uuid.GenerateUUID()
return fmt.Sprintf("%x", md5.Sum([]byte(s)))[:12]
}