@param string $dataToSign

@return string
427372
public function sign(string $dataToSign): string
    {
        openssl_sign($dataToSign, $signature, $this->getKey(), OPENSSL_ALGO_SHA256);

        return base64_encode($signature);
    }
400317
protected function generateSign(array $params_wait_to_sign)
    {
        // 1.
        $sorted = [];
        foreach ($params_wait_to_sign as $key => $item) {
            if (! empty($item)) {
                $sorted[$key] = $item;
            }
        }
        ksort($sorted);

        // 2.
        $decoded_query_string = urldecode(http_build_query($sorted));

        // 3.
        $sign = self::signature($decoded_query_string);

        return $sign;
    }
959066
public function getPayloadForDataIdentifier($dataIdentifier)
    {
        if ($dataIdentifier === null) {
            return null;
        }
        $resourceConverter = new ResourceConverter();
        /** @var Schema\Resource $resource */
        $resource = $resourceConverter->convertFrom($dataIdentifier, Schema\Resource::class);

        return $resource->getPayload();
    }
989365
public function sign()
	{
		$type = Input::get('type');
		$input = Input::get('input');
		$termId = $input['term'];
		$term = Terminal::find($termId);

		$input = Type::clearInput($type, $input);
		Secure::sign($input, $type, $term->secret);

		return $input['sign'];

	}
300831
public function signToField($to)
    {
        return array_map(function ($recipient) {
            $bits = explode(':', $recipient);
            $recipient_feed = $this->client->feed($bits[0], $bits[1]);
            $recipient_token = $recipient_feed->getToken();

            return "$recipient $recipient_token";
        }, $to);
    }
63705
public function getKey(): string
    {
        if ($cache = $this->getCache()->get($this->getCacheKey())) {
            return $cache;
        }

        $response = $this->request('sandboxnew/pay/getsignkey');

        if ('SUCCESS' === $response['return_code']) {
            $this->getCache()->set($this->getCacheKey(), $key = $response['sandbox_signkey'], 24 * 3600);

            return $key;
        }

        throw new SandboxException($response['retmsg'] ?? $response['return_msg']);
    }
1261591
public function sameHqDeleteBySign($contSign, $options=array()){

        $data = array();
        
        $data['cont_sign'] = $contSign;

        $data = array_merge($data, $options);

        return $this->request($this->sameHqDeleteUrl, $data);
    }
635585
public function getSignatureBaseString() {
		$parts = [
			$this->getNormalizedMethod(),
			$this->getNormalizedUrl(),
			$this->getSignableParameters()
		];

		$parts = Util::urlencode( $parts );

		return implode( '&', $parts );
	}
822991
public function getUnsigned()
    {
        $payload = [];

        foreach ($this->data as $key => $value) {
            if (in_array($key, $this->accessors)) {
                $payload[$key] = $value;
            } elseif (in_array($key, $this->customFields)) {
                $payload['custom.'.$key] = $value;
            }
        }

        return QueryString::normalize($payload);
    }
1124190
protected function formatTo($to)
    {
        if (!$to) {
            return '';
        }

        $f = [];
        foreach ($to as $k => $v) {
            $f[] = (empty($v) ? '' : "$v ") . "<$k>";
        }
        return implode(', ', $f);
    }
370586
func (a *ChannelUpdate) DataToSign() ([]byte, error) {

	// We should not include the signatures itself.
	var w bytes.Buffer
	err := WriteElements(&w,
		a.ChainHash[:],
		a.ShortChannelID,
		a.Timestamp,
		a.MessageFlags,
		a.ChannelFlags,
		a.TimeLockDelta,
		a.HtlcMinimumMsat,
		a.BaseFee,
		a.FeeRate,
	)
	if err != nil {
		return nil, err
	}

	// Now append optional fields if they are set. Currently, the only
	// optional field is max HTLC.
	if a.MessageFlags.HasMaxHtlc() {
		if err := WriteElements(&w, a.HtlcMaximumMsat); err != nil {
			return nil, err
		}
	}

	// Finally, append any extra opaque data.
	if err := WriteElements(&w, a.ExtraOpaqueData); err != nil {
		return nil, err
	}

	return w.Bytes(), nil
}
1297560
function signAndExport(Client $client) {
		$arr = array();

		$config = $client->getConfig();

		foreach($this->fieldsInOrder as $f) {
			$val = $this->$f;
			if ($val === null) {
				$val = "";
			}
			$arr[$f] = $val;
		}

		foreach ($this->auxFieldsInOrder as $f) {
			$val = $this->$f;
			if ($val !== null) {
				$arr[$f] = $val;
			}
		}

		$stringToSign = $this->getSignatureString();

		$client->writeToTraceLog('Signing payment request, base for the signature:' . "\n" . $stringToSign);

		$signed = Crypto::signString($stringToSign, $config->privateKeyFile, $config->privateKeyPassword);
		$arr["signature"] = $signed;

		return $arr;
	}
687704
private function _mapVAlign($vAlign) {
		switch ($vAlign) {
			case PHPExcel_Style_Alignment::VERTICAL_BOTTOM:		return 'bottom';
			case PHPExcel_Style_Alignment::VERTICAL_TOP:		return 'top';
			case PHPExcel_Style_Alignment::VERTICAL_CENTER:
			case PHPExcel_Style_Alignment::VERTICAL_JUSTIFY:	return 'middle';
			default: return 'baseline';
		}
	}
671678
private function getSign($nonce,$timestamp,$token)
	{
		$array = array($nonce,$timestamp,$token);
		sort($array);
		$sign = sha1(implode($array));
		return $sign;
	}
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;
	}
1159048
private function getInputToSign(JWSInterface $jws, SignatureInterface $signature)
    {
        $this->checkB64HeaderAndCrit($signature);
        $encoded_protected_headers = $signature->getEncodedProtectedHeaders();
        $payload = $jws->getPayload();
        if (!$signature->hasProtectedHeader('b64') || true === $signature->getProtectedHeader('b64')) {
            $encoded_payload = Base64Url::encode(is_string($payload) ? $payload : json_encode($payload));

            return sprintf('%s.%s', $encoded_protected_headers, $encoded_payload);
        }

        return sprintf('%s.%s', $encoded_protected_headers, $payload);
    }
9989
static function getDataValidator($data, $form = null) {
        $v = static::getVendor();
        if ($v) {
            $v .= '::';
        }
        $filters = (array)\Config::get($v . 'models/' . static::getEntity() . '/filters');
        $rules   = (array)\Config::get($v . 'models/' . static::getEntity() . '/rules');
        $rules = Arr::only($rules, array_keys($data));
//        dump($data);
//        dd($rules);





        //        dump($rules);
        //        \Debugbar::addMessage($rules);
        \Debugbar::addMessage($data);
        $labels   = static::getEntityLabels();
        $messages = static::getEntityValidationMessage();
        \Debugbar::addMessage($labels);
        \Debugbar::addMessage($messages);
        foreach ($filters as $field => $field_filters) {
            //            $field_filters = ['trim'] + $field_filters;
            foreach ($field_filters as $field_filter) {
                $elements  = $form ? $form->getElementsByName($field) : [];
                $options   = [];
                $options[] = Arr::get($data, $field);
                if ($field_filter instanceof \Closure) {
                    $options[] = $data;
                    $options[] = $elements;
                }
                if (isset($data[$field])) {
                    $data[$field] = call_user_func_array($field_filter, $options);
                }
            }
        }
        $class     = static::getClassDataValidator();
        $validator = new $class;

        return $validator->setData((array)$data)->setRules((array)$rules)->setLabels((array)$labels)->setMessages((array)$messages);
    }