feat: add aispeech dialog APIs (#887)

* feat: add aispeech dialog APIs

* test: fix aispeech lint failures

* test: satisfy aispeech interfacer lint
This commit is contained in:
GargantuaX authored and GitHub committed 2026-07-20 14:10:56 +08:00
1 parent 0e34286d78
commit 2bc22dc4ae
18 files changed
+1562 -3

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
package encryptor
import (
"crypto/md5"
"encoding/hex"
"strconv"
)
// Sign calculates the aispeech request signature.
func Sign(token string, timestamp int64, nonce string, body []byte) string {
bodyMD5 := md5.Sum(body)
bodySign := hex.EncodeToString(bodyMD5[:])
h := md5.New()
h.Write([]byte(token))
h.Write([]byte(strconv.FormatInt(timestamp, 10)))
h.Write([]byte(nonce))
h.Write([]byte(bodySign))
return hex.EncodeToString(h.Sum(nil))
}