生成支付签名
@param array $data 参与签名的数据
@param string $signType 参与签名的类型
@param string $buff 参与签名字符串前缀
@return string
176245
public function getPaySign(array $data, $signType = 'MD5', $buff = '')
    {
        ksort($data);
        if (isset($data['sign'])) unset($data['sign']);
        foreach ($data as $k => $v) $buff .= "{$k}={$v}&";
        $buff .= ("key=" . $this->config->get('mch_key'));
        if (strtoupper($signType) === 'MD5') {
            return strtoupper(md5($buff));
        }
        return strtoupper(hash_hmac('SHA256', $buff, $this->config->get('mch_key')));
    }
470995
public function create($data, $token = null)
    {
        if (isset($token)) {
            return $this->client()->put($data, 'password-tokens/{token}', ['token' => $token]);
        }

        return $this->client()->post($data, 'password-tokens');
    }
33594
public function createSign($data = '')
    {
        if (!is_string($data)) {
            return null;
        }
        return openssl_sign(
                    $data,
                    $sign,
                    self::getPrivateKey(),
                    OPENSSL_ALGO_SHA256
                  ) ? base64_encode($sign) : null;
    }
948555
public function getSignText($data, $partnerId)
    {
        foreach ($data as $key=>$value) {
            if ($value === '' or $value === null) {
                unset($data[$key]);
            }
        }
        ksort($data);

        $str = Helper::setParams($data);
        $str .= "&key=".$partnerId;
        $key = strtoupper(md5($str));

        return $key;
    }
163523
public function createSign($data, $private_key_path)
    {
        $priKey = file_get_contents($private_key_path);
        $res = openssl_get_privatekey($priKey);
        openssl_sign($data, $sign, $res);
        openssl_free_key($res);
        //base64编码
        $sign = base64_encode($sign);
        return $sign;
    }
1340965
public static final String asString(WsByteBuffer buff) {
        byte[] data = asByteArray(buff);
        return (null != data) ? new String(data) : null;
    }
255712
public static function encode($data, String $type = 'unescapedUnicode') : String
    {
        return json_encode($data, Helper::toConstant($type, 'JSON_'));
    }
967604
private function makeSignature($data)
    {
        $signature = '';
        $this->initOpenSSL();
        if (!openssl_sign($data, $signature, $this->privateKey, 'sha256')) {
            throw new SignatureException(openssl_error_string());
        }
        return $signature;
    }
1314730
public function userCredentials(array $data = [])
    {

        $data = $this->mergeData($data);

        $refreshCredentials = new OAuth2TokenBuilder();

        return $refreshCredentials->withClientId($data['clientId'])
            ->withClientSecret($data['clientSecret'])
            ->withRefreshToken($data['refreshToken'])
            ->build();
    }
334311
public function MakeSign()
	{
		//签名步骤一：按字典序排序参数
		ksort($this->values);
		$string = $this->ToUrlParams();
		//签名步骤二：在string后加入KEY
		$string = $string . "&key=".WxPayConfig::$KEY;
		//签名步骤三：MD5加密
		$string = md5($string);
		//签名步骤四：所有字符转为大写
		$result = strtoupper($string);
		return $result;
	}
72153
public function createSign($data)
	{
		$data = $data . self::getSecretKey() . self::getPrivateKey();
		return md5($data);
	}
593152
function name_data($data){
		if ($data=="tr_pid")
			return $this->config->relation_id["db_name"];
		if ($data=="tr_text")
			return $this->config->text[0]["db_name"];
		return $data;
	}
764182
public function w($type, $data) {
    switch ($type) {
      case self::uint8:
        return $this->writeUInt8($data);
      case self::int8:
        return $this->writeInt8($data);
      case self::uint16:
        return $this->writeUInt16($data);
      case self::int16:
        return $this->writeInt16($data);
      case self::uint32:
        return $this->writeUInt32($data);
      case self::int32:
        return $this->writeUInt32($data);
      case self::shortFrac:
        return $this->writeFixed($data);
      case self::Fixed:
        return $this->writeFixed($data);
      case self::FWord:
        return $this->writeInt16($data);
      case self::uFWord:
        return $this->writeUInt16($data);
      case self::F2Dot14:
        return $this->writeInt16($data);
      case self::longDateTime:
        return $this->writeLongDateTime($data);
      case self::char:
        return $this->write($data, 1);
      default:
        if (is_array($type)) {
          if ($type[0] == self::char) {
            return $this->write($data, $type[1]);
          }

          $ret = 0;
          for ($i = 0; $i < $type[1]; $i++) {
            if (isset($data[$i])) {
              $ret += $this->w($type[0], $data[$i]);
            }
          }

          return $ret;
        }

        return null;
    }
  }
501603
public function sign($data) {
    /* Remove signature from server. */
    unset($data['h']);

    /* Sort keys alphabetically. */
    ksort($data);

    /* Build query string to sign. */
    $n = count($data);
    $query = '';
    $i = 0;
    while(list($key, $val) = each($data)) {
      $i++;
      $query .= $key.'='.$val;
      if($i < $n) {
        $query.= '&';
      }
    }

    /* Sign. */
    $sign = hash_hmac('sha1', utf8_encode($query), base64_decode($this->clientSecret), true);
    return base64_encode($sign);
  }
1052460
private function createToken($type, $position, array $data)
    {
        if ($type === Tokenizer::TOKEN_GROUP_BEGIN) {
            return $this->createGroupBeginToken($position, $data);
        }

        if ($type === Tokenizer::TOKEN_TERM) {
            return $this->createTermToken($position, $data);
        }

        return new Token($type, $data['lexeme'], $position);
    }
397957
public function rsaCheckV1($params, $rsaPublicKeyFilePath,$signType='RSA') {
		$sign = $params['sign'];
		$params['sign_type'] = null;
		$params['sign'] = null;
		return $this->verify($this->getSignContent($params), $sign, $rsaPublicKeyFilePath,$signType);
	}
1022806
public static String genPaySign(Map<String, Object> map, String key, String signType) {
        String[] nms = map.keySet().toArray(new String[map.size()]);
        Arrays.sort(nms);
        StringBuilder sb = new StringBuilder();
        signType = signType == null ? "MD5" : signType.toUpperCase();
        boolean isMD5 = "MD5".equals(signType);
        for (String nm : nms) {
            Object v = map.get(nm);
            if (null == v)
                continue;
            // JSSDK 支付签名时间戳，注意微信jssdk中的所有使用timestamp字段均为小写。
            // 但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
            if (isMD5 && "timestamp".equals(nm)) {
                nm = "timeStamp";
            }
            String s = v.toString();
            if (Strings.isBlank(s))
                continue;
            sb.append(nm).append('=').append(s).append('&');
        }
        sb.append("key=").append(key);
        return Lang.digest(signType, sb).toUpperCase();
    }