func signV4TrimAll(input string) string {
	return strings.Join(strings.Fields(input), " ")
}
Trim leading and trailing spaces and replace sequential spaces with one space, following Trimall()
in http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
package signer
import (
	"crypto/hmac"
	"net/http"
	"strings"
	"github.com/minio/sha256-simd"
)
const unsignedPayload = "UNSIGNED-PAYLOAD"
func sum256(data []byte) []byte {
	hash := sha256.New()
	hash.Write(data)
	return hash.Sum(nil)
}
func sumHMAC(key []byte, data []byte) []byte {
	hash := hmac.New(sha256.New, key)
	hash.Write(data)
	return hash.Sum(nil)
}
func getHostAddr(req *http.Request) string {
	if req.Host != "" {
		return req.Host
	}
	return req.URL.Host
}