code: func joseBase64UrlEncode(b []byte) string {
  	return strings.TrimRight(base64.URLEncoding.EncodeToString(b), "=")
  }
docs: // joseBase64UrlEncode encodes the given data using the standard base64 url
  // encoding format but with all trailing '=' characters omitted in accordance
  // with the jose specification.
  // http://tools.ietf.org/html/draft-ietf-jose-json-web-signature-31#section-2