Return a string for sign() with the given `options`.

Spec:

<verb>\n
<md5>\n
<content-type>\n
<date>\n
[headers\n]
<resource>

@param {Object} options
@return {String}
@api private
184964
function stringToSign (options) {
  var headers = options.amazonHeaders || ''
  if (headers) headers += '\n'
  var r = 
    [ options.verb
    , options.md5
    , options.contentType
    , options.date ? options.date.toUTCString() : ''
    , headers + options.resource
    ]
  return r.join('\n')
}
220805
function signRequest(method, URI, host, port, token, secret, hashMethod, timestamp, nonce, bodyHash) {

    // Parse request URI

    var uri = URL.parse(URI, true);

    if (uri.pathname == null) {

        // Error: Bad request URI
        return "";
    }

    // Construct normalized request string

    var normalized = token + '\n' +
                     timestamp + '\n' +
                     nonce + '\n' +
                     bodyHash + '\n' +
                     method.toUpperCase() + '\n' +
                     host.toLowerCase() + '\n' +
                     port + '\n' +
                     uri.pathname + '\n';

    // Normalize parameters

    var params = new Array;

    if (uri.query) {

        var count = 0;
        for (var p in uri.query) {

            if (typeof uri.query[p] == 'string') {

                params[count++] = percentEscape(p) + "=" + percentEscape(uri.query[p]);
            }
            else {

                for (var i in uri.query[p]) {

                    params[count++] = percentEscape(p) + "=" + percentEscape(uri.query[p][i]);
                }
            }
        }

        params.sort();

        for (var i in params) {

            normalized += params[i] + '\n';
        }
    }

    // Sign normalized request string

    var hmac = Crypto.createHmac(hashMethod, secret).update(normalized);
    var digest = hmac.digest(encoding = "base64");
    return digest;
}
219326
function getSignature ({
  params,
  accessKeySecret
}) {
  const paramString = paramsToString(params)
  const stringToSign = `POST&${encodeURIComponent('/')}&${encodeURIComponent(paramString)}`

  return crypto
    .createHmac('sha1', `${accessKeySecret}&`)
    .update(stringToSign)
    .digest('base64')
}
36951
function(method, url, date) {
        var timestamp = (date || new Date()).toISOString().replace(/\.\d+Z$/, 'Z'),
            addPubKey = this.options.user !== this.options.publicKey,
            qs = url.toString().indexOf('?') > -1 ? '&' : '?',
            signUrl = addPubKey ? url + qs + 'publicKey=' + this.options.publicKey : url,
            signature = this.generateSignature(method, signUrl.toString(), timestamp);

        qs = addPubKey ? '&' : qs;
        qs += 'signature=' + encodeURIComponent(signature);
        qs += '&timestamp=' + encodeURIComponent(timestamp);

        return signUrl + qs;
    }
810218
function getFontId (name, options) {

    var values = getFontId.keys.map(function (key, index) {

        var value = options[key] || getFontId.values[index];

        if (typeof value !== 'string') {
            value = getFontId.values[index];
        } else if (getFontId.alias[key]) {
            value = value.replace.apply(value, getFontId.alias[key]);
        }

        return value;
    });

    values.unshift(name);

    var id = values.join('-');
    id = crypto.createHash('md5').update(id).digest('hex');

    return id;
}
966376
function makeSignature(params) {
	if (!params) return "()";
	var signature = "("
	+
	params.filter(
		function($) {
			return $.name.indexOf(".") == -1; // don't show config params in signature
		}
	).map(
		function($) {
			return $.name;
		}
	).join(", ")
	+
	")";
	return signature;
}
1013699
function signedRequestHeaders(apiKey, apiSecretKey, apiUserToken, options) {
  if (!apiKey || !apiSecretKey || !apiUserToken) {
    return false;
  }
  var apiExpDate = Math.floor(Date.now() / 1000) + 600;
  var payload = apiKey + apiUserToken + apiExpDate;
  var hash = CryptoJS.HmacSHA256(payload, apiSecretKey);
  var headers = {
    'x-api-key': apiKey,
    'x-api-user-token': apiUserToken,
    'x-api-signature': 'Method=HMAC-SHA256 Signature=' + hash,
    'x-api-exp-date': apiExpDate,
  };
  return headers;
}
873377
def _sign_payload(self, payload):
        
        app_key = self._app_key
        t = int(time.time() * 1000)
        requestStr = {
            'header': self._req_header,
            'model': payload
        }
        data = json.dumps({'requestStr': json.dumps(requestStr)})
        data_str = '{}&{}&{}&{}'.format(self._req_token, t, app_key, data)
        sign = hashlib.md5(data_str.encode('utf-8')).hexdigest()
        params = {
            't': t,
            'appKey': app_key,
            'sign': sign,
            'data': data,
        }
        return params
987164
def sign(params = {})
      params = additional_params.merge(params)
      digest = params.sort_by(&:first).map{ |key, value| "#{key}=#{value}" }.join

      if oauth2_session?
        params[:sig] = Digest::MD5.hexdigest("#{digest}" + Digest::MD5.hexdigest(options[:access_token] + SchoolFriend.secret_key))
        params[:access_token] = options[:access_token]
      else
        params[:sig] = Digest::MD5.hexdigest("#{digest}#{signature}")
      end

      params
    end
919001
function signatureBaseString (method, url, parameters) {
  return method.toUpperCase() + '&' +
  encodeOAuthData(signatureBaseStringURI(url)) + '&' +
  encodeOAuthData(parameters)
}
579842
function doQuery(options) {
            return models.User.changePassword(
                options.data.password[0],
                _.omit(options, ['data'])
            ).then(() => {
                return Promise.resolve({
                    password: [{message: common.i18n.t('notices.api.users.pwdChangedSuccessfully')}]
                });
            });
        }
774226
function getToken(params) {

      var api = params.api;
      var data = params.data;
      var operator = params.operator;
      var t = params.t;
      var token = params.token;

      if (!api || !data || !operator || !t || !token) {
          return;
      }

      var SPLIT_STR = "&";

      return md5([api, data, operator, t, token].join(SPLIT_STR));

    }
1107986
def signature_base_string(request, token = nil, request_options = {})
      request.signature_base_string(http, self, token, options.merge(request_options))
    end
763591
def generate_string_to_sign(date, region, canonical_request):
    
    formatted_date_time = date.strftime("%Y%m%dT%H%M%SZ")

    canonical_request_hasher = hashlib.sha256()
    canonical_request_hasher.update(canonical_request.encode('utf-8'))
    canonical_request_sha256 = canonical_request_hasher.hexdigest()
    scope = generate_scope_string(date, region)

    return '\n'.join([_SIGN_V4_ALGORITHM,
                      formatted_date_time,
                      scope,
                      canonical_request_sha256])
563279
def get_signature(self, req):
        
        oss_url = url.URL(req.url)

        oss_headers = [
            "{0}:{1}\n".format(key, val)
            for key, val in req.headers.lower_items()
            if key.startswith(self.X_OSS_PREFIX)
        ]
        canonicalized_headers = "".join(sorted(oss_headers))
        logger.debug(
            "canonicalized header : [{0}]".format(canonicalized_headers)
        )

        oss_url.params = {
            key: val
            for key, val in oss_url.params.items()
            if key in self.SUB_RESOURCES or key in self.OVERRIDE_QUERIES
        }

        oss_url.forge(key=lambda x: x[0])
        canonicalized_str = "{0}/{1}{2}".format(
            canonicalized_headers,
            self.get_bucket(oss_url.host),
            oss_url.uri
        )

        str_to_sign = "\n".join([
            req.method,
            req.headers["content-md5"],
            req.headers["content-type"],
            req.headers["date"],
            canonicalized_str
        ])
        logger.debug(
            "signature str is \n{0}\n{1}\n{0}\n".format("#" * 20, str_to_sign)
        )
        if isinstance(str_to_sign, requests.compat.str):
            str_to_sign = str_to_sign.encode("utf8")

        signature_bin = hmac.new(self._secret_key, str_to_sign, hashlib.sha1)
        signature = base64.b64encode(signature_bin.digest()).decode("utf8")
        logger.debug("signature is [{0}]".format(signature))
        return signature
564738
def signed_raw(self) -> str:
        
        raw = self.raw()
        signed = "\n".join(self.signatures)
        signed_raw = raw + signed + "\n"
        return signed_raw
423594
function optionsFromStrings(options) {
	var intOptions = ["width", "height", "textMargin", "fontSize", "margin", "marginTop", "marginBottom", "marginLeft", "marginRight"];

	for (var intOption in intOptions) {
		if (intOptions.hasOwnProperty(intOption)) {
			intOption = intOptions[intOption];
			if (typeof options[intOption] === "string") {
				options[intOption] = parseInt(options[intOption], 10);
			}
		}
	}

	if (typeof options["displayValue"] === "string") {
		options["displayValue"] = options["displayValue"] != "false";
	}

	return options;
}