feat: merge sms branch,add DuanXinBao sms service implemetation

This commit is contained in:
RockYang
2024-01-23 16:16:47 +08:00
17 changed files with 194 additions and 35 deletions

View File

@@ -4,8 +4,10 @@ import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/md5"
"crypto/sha256"
"encoding/base64"
"encoding/hex"
"errors"
"fmt"
"io"
@@ -82,3 +84,8 @@ func Sha256(data string) string {
hashValue := hash.Sum(nil)
return fmt.Sprintf("%x", hashValue)
}
func Md5(data string) string {
md5bs := md5.Sum([]byte(data))
return hex.EncodeToString(md5bs[:])
}