func GenerateHTTPRequestHash(r *http.Request, timestamp int64) ([]byte, error) {
	method := r.Method

	u, err := url.QueryUnescape(r.URL.String())
	if err != nil {
		return nil, err
	}

	b, err := ReadRequestBody(r)
	if err != nil {
		return nil, err
	}

	toSign := []byte(method)
	toSign = append(toSign, []byte(u)...)
	toSign = append(toSign, []byte(strconv.FormatInt(timestamp, 10))...)
	if b != nil {
		toSign = append(toSign, b...)
	}
	result := sha256.Sum256(toSign)
	return result[:], nil
}
// GenerateHTTPRequestHash retrieves a sha256 from the following message:
// request method + request url + timestamp + request body
GenerateHTTPRequestHash retrieves a sha256 from the following message:
request method + request url + timestamp + request body
// GenerateHTTPRequestHash retrieves a sha256 from the following message : // request method + request url + timestamp + request body
func GenerateHTTPRequestHash(r *http.Request, timestamp int64) ([]byte, error) {
	method := r.Method
	u, err := url.QueryUnescape(r.URL.String())
	if err != nil {
		return nil, err
	}
	b, err := ReadRequestBody(r)
	if err != nil {
		return nil, err
	}
	toSign := []byte(method)
	toSign = append(toSign, []byte(u)...)
	toSign = append(toSign, []byte(strconv.FormatInt(timestamp, 10))...)
	if b != nil {
		toSign = append(toSign, b...)
	}
	result := sha256.Sum256(toSign)
	return result[:], nil
}
func GenerateHTTPRequestHash ( r * http . Request , timestamp int64 ) ( [ ] byte , error ) { method := r . Method u , err := url . QueryUnescape ( r . URL . String ( ) ) if err != nil { return nil , err } b , err := ReadRequestBody ( r ) if err != nil { return nil , err } toSign := [ ] byte ( method ) toSign = append ( toSign , [ ] byte ( u ) ... ) toSign = append ( toSign , [ ] byte ( strconv . FormatInt ( timestamp , 10 ) ) ... ) if b != nil { toSign = append ( toSign , b ... ) } result := sha256 . Sum256 ( toSign ) return result [ : ] , nil }
GenerateHTTPRequestHash retrieves a sha256 from the following message:
request method + request url + timestamp + request body
GenerateHTTPRequestHash retrieves a sha256 from the following message : request method + request url + timestamp + request body