add signatures to messages to avoid double processing

This commit is contained in:
Chris Lu
2020-08-28 23:48:48 -07:00
parent 63ad1abcce
commit ca658a97c5
29 changed files with 331 additions and 214 deletions

View File

@@ -2,6 +2,7 @@ package util
import (
"crypto/md5"
"crypto/rand"
"encoding/base64"
"fmt"
"io"
@@ -135,3 +136,9 @@ func Base64Md5ToBytes(contentMd5 string) []byte {
}
return data
}
func RandomInt32() int32 {
buf := make([]byte, 4)
rand.Read(buf)
return int32(BytesToUint32(buf))
}