hmac.go
func (hs *HmacSigner) Sign(buf []byte) ([]byte, error) {
	sig, err := hs.SignBytes(buf)
	if err != nil {
		return nil, err
	}

	enc := make([]byte, b64.EncodedLen(len(sig)))
	b64.Encode(enc, sig)

	return enc, nil
}
func (hs *HmacSigner) Sign(buf []byte) ([]byte, error) {
	sig, err := hs.SignBytes(buf)
	if err != nil {
		return nil, err
	}

	enc := make([]byte, b64.EncodedLen(len(sig)))
	b64.Encode(enc, sig)

	return enc, nil
}
func ( hs * HmacSigner ) Sign ( buf [ ] byte ) ( [ ] byte , error ) { sig , err := hs . SignBytes ( buf ) if err != nil { return nil , err } enc := make ( [ ] byte , b64 . EncodedLen ( len ( sig ) ) ) b64 . Encode ( enc , sig ) return enc , nil }
// Sign creates a signature for buf, returning it as a URL-safe base64 encoded
// byte slice.
Sign creates a signature for buf returning it as a URL - safe base64 encoded byte slice .