根据参数拼接字符串生成 token
@param params
@returns {String}
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));

    }
1237136
function _buildAppRequestParams(params) {
  params = params || {};

  var basePath = config.addURIParams(constants.APP_API_PATH, params);

  var fullPath = basePath + params.resourcePath;

  var mbaasUrl = url.parse(params.url);

  mbaasUrl.pathname = fullPath;

  var headers = {
    'x-fh-env-access-key': params.accessKey,
    'x-fh-auth-app': params.appApiKey
  };

  return {
    url: mbaasUrl.format(mbaasUrl),
    method: params.method,
    headers: headers,
    fileRequest: params.fileRequest,
    fileUploadRequest: params.fileUploadRequest,
    data: params.data,
    paginate: params.paginate
  };
}
1269453
protected String buildParamsQuery(final Map<String, String> params)
			throws UnsupportedEncodingException {
		StringBuilder builder = new StringBuilder();
		if (params.isEmpty()) {
			return builder.toString();
		}

		String sep = "";
		for (Map.Entry<String, String> entry : params.entrySet()) {
			builder.append(sep);
			builder.append(urlencode(entry.getKey()));
			builder.append("=");
			builder.append(urlencode(entry.getValue()));
			sep = "&";
		}

		return builder.toString();
	}
531404
public static String generateQuery(final Map<String,Object> params){
		final StringBuilder sb = new StringBuilder();
		boolean newEntry = false;
		
		sb.append("{");
		for(final Entry<String,Object> param: params.entrySet()){
			if(newEntry){
				sb.append(", ");
			}

			sb.append(param.getKey());
			sb.append(": ");
			sb.append(getParam(param.getValue()));
			newEntry = true;
		}
		sb.append("}");
		
		return sb.toString();
	}
866256
function(params, callback) {
                var keyId;

                if (params) {
                    if (params.keyId != 'undefined') {
                        keyId = params.keyId;
                    }
                }

                var httpRequestParams = {
                    url: SERVICE_ADDRESSES.SSO_ADDRESS + SERVICES_PATH.SSO_GET_KEY + keyId,
                    method: 'GET',
                    headers: {
                        'Authorization': 'Bearer ' + token
                    }
                };

                httpRequest(httpRequestParams, function(result) {
                    if (!result.hasError) {
                        try {
                            var response = JSON.parse(result.result.responseText);
                        }
                        catch (e) {
                            console.log(e);
                        }

                        callback && callback({
                            hasError: false,
                            secretKey: response.secretKey
                        });
                    }
                    else {
                        callback && callback({
                            hasError: true,
                            code: result.errorCode,
                            message: result.errorMessage
                        });

                        fireEvent('error', {
                            code: result.errorCode,
                            message: result.errorMessage,
                            error: result
                        });
                    }
                });
            }
430957
public static function getToken($params = null)
    {
        if (!$params) {
            $params = array();
        }
        $requestor = new ApiRequestor(Sumup::$connectBase, true);
        $params['client_id'] = self::_getConnectParam('client_id', $params);
        $params['client_secret'] = self::_getConnectParam('client_secret', $params);
        $response = $requestor->request('post', '/token', $params);

        if ($response->raw->getStatusCode() !== 200) {
            throw new Error\AuthenticationError('Token request error');
        }

        return new AccessToken($response);
    }
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;
}
179184
protected void parseParams(Map<String, String> params) {
        generateAlgorithm = indexOf(PARAM_ALGORITHM, DEFAULT_ALGORITHM, SUPPORTED_ALGORITHMS, params.get(PARAM_ALGORITHM));
        generateIterations = parseInt(PARAM_ITERATIONS, params.get(PARAM_ITERATIONS), DEFAULT_ITERATIONS, MINIMUM_ITERATIONS);
        generateSaltSize = parseInt(PARAM_SALTSIZE, params.get(PARAM_SALTSIZE), DEFAULT_SALTSIZE, MINIMUM_SALTSIZE);
        generateKeySize = parseInt(PARAM_KEYSIZE, params.get(PARAM_KEYSIZE), DEFAULT_KEYSIZE, MINIMUM_KEYSIZE);
    }
172256
function (params, noEncode) {
      if(this.isObject(params)){

        var paramsStr = [];

        for (var key in params) {
          if (params.hasOwnProperty(key) && params[key] !== undefined) {
            var value = this.isObject(params[key])? this.buildParams(params[key], true) : params[key];
            paramsStr.push((noEncode? key : encodeURIComponent(key)) +
              '=' + (noEncode? this.escapeSpecials(value) : encodeURIComponent(value)));
          }
        }

        // Build string from the array.
        return paramsStr.join('&');

      } else {
        return params;
      }
    }
724679
def generate_signature(params, returns, condition=nil)
      params = params.split(//) if params.respond_to?(:split) # Convert params string into array
      params.map! {|param| TYPES[param.to_sym] || param} # Convert chars into FFI type symbols
      returns = TYPES[returns.to_sym] || returns # Convert chars into FFI type symbols
      [params, returns, condition]
    end
263842
function(params) {
    var keys = _.keysIn(
                  _.pick(
                    params,
                    ['fieldSelector', 'labelSelector'])
                ).sort();
    return _.reduce(
            keys,
            function(result, key, i) {
              return result + key + '=' + encodeURIComponent(params[key]) +
                      ((i < (keys.length-1)) ? '&' : '');
            }, '?');

  }
458998
function _parseParams(params) {
  return params.map((param) => {
    let result;
    switch (param.type) {
      case 'Identifier':
        result = new Param(param.name);
        break;
      case 'AssignmentPattern':
        result = new Param(param.left.name, true);
        break;
      case 'ObjectPattern': {
        const objParams = param.properties.map((objParam) => objParam.value);
        result = new Param('arguments', false, _parseParams(objParams));
        break;
      }
      default:
    }
    return result;
  });
}
1027338
protected function generateMd5Sign($params = [])
    {
        static::sortParams($params);  // 排序

        $arr = [];
        foreach ($params as $k => $v) {
            $arr[] = $k . $v;
        }
        
        $str = $this->app->app_secret . implode('', $arr) . $this->app->app_secret;

        return strtoupper(md5($str));
    }
221113
function createToken(username, done) {
  return getUser(username, function(getUserErr, user) {
    if (getUserErr) {
      return done(getUserErr);
    }

    if (!user) {
      return done(new Error(`user '${username}' not found`));
    }

    const token = uuid.v4();

    return hashToken(token, function(cryptErr, hash) {
      if (cryptErr) {
        return done(cryptErr);
      }

      return getModels(function(m) {
        m.collections.token.create({
          uuid: hash,
          owner: user.id,
        }, function(createTokenErr) {
          if (createTokenErr) {
            return done(createTokenErr);
          }

          return done(null, token);
        }); // m.collections.token.create
      }); // getModels
    }); // hashToken
  }); // getUser
}
358221
protected String doSign(final Map<String, String> params) {
        StringBuilder signing = new StringBuilder();

        for (Map.Entry<String, String> entry : params.entrySet()) {
            if (!Strings.isNullOrEmpty(entry.getValue())){
                signing.append(entry.getKey()).append('=').append(entry.getValue()).append("&");
            }
        }

        // append key
        signing.append("key=").append(wepay.getAppKey());

        // md5
        return MD5.generate(signing.toString(), false).toUpperCase();
    }
1209116
private static function generateCode($args, array $params)
    {
        $args = trim($args);
        if (!$args) return '';

        $codeArgs = '';

        $list = token_get_all("<?php " . $args);
        $params_toks = [];
        $i = 0;
        foreach ($list as $tok) {
            if ($tok === ',') {
                $i++;
                continue;
            }
            $params_toks[$i][] = $tok;
        }

        foreach ($params_toks as $i => $toks) {
            $isRef = false;
            $varName = false;
            $haveDefault = false;
            $default = "";
            $mode = 'var';

            foreach ($toks as $tok) {
                if ($tok === '&') {
                    $isRef = true;
                    continue;
                }

                if ($tok === '=') {
                    $haveDefault = true;
                    $mode = 'default';
                    continue;
                }

                if ($mode == 'default') {
                    $default .= is_array($tok) ? $tok[1] : $tok;
                    continue;
                }

                if ($tok[0] === T_VARIABLE) {
                    $varName = $tok[1];
                }
            }

            if ($haveDefault) {
                $codeArgs .= "if (count(\$mm_func_args) > $i) {\n";
            }

            if ($isRef && isset($params[$i])) {
                $param_name = $params[$i]->getName();
                if (ltrim($varName, '$') !== $param_name) {
                    $codeArgs .= "$varName = &\$$param_name;\n";
                }
            } else {
                $codeArgs .= "$varName = \$params[$i];\n";
            }

            if ($haveDefault) {
                $codeArgs .= "} else {\n";
                $codeArgs .= "$varName = $default;\n";
                $codeArgs .= "}\n";
            }
        }

        return $codeArgs;
    }
439035
public static String concat(Object... params) {
		StringBuffer finalMessage = new StringBuffer();
		for (Object object : params) {
			finalMessage.append(JKObjectUtil.toString(object, true));
		}
		return finalMessage.toString();
	}