获取js-sdk所需的签名，给调用者最大的自由度，控制生成签名的参数
@param nonceStr 随机字符串
@param timestame 时间戳
@param url 当前网页的URL，不包含#及其后面部分
@return 签名以及相关参数
487541
public GetSignatureResponse getSignature(String nonceStr, long timestame, String url) {
        BeanUtil.requireNonNull(url, "请传入当前网页的URL，不包含#及其后面部分");
        GetSignatureResponse response = new GetSignatureResponse();
        String jsApiTicket = this.config.getJsApiTicket();
        String sign;
        try {
            sign = JsApiUtil.sign(jsApiTicket, nonceStr, timestame, url);
        } catch (Exception e) {
            LOG.error("获取签名异常:", e);
            response.setErrcode(ResultType.OTHER_ERROR.getCode().toString());
            response.setErrmsg("获取签名异常");
            return response;
        }
        response.setNoncestr(nonceStr);
        response.setSignature(sign);
        response.setTimestamp(timestame);
        response.setUrl(url);
        response.setErrcode(ResultType.SUCCESS.getCode().toString());
        return response;
    }
469369
public String getOneTimeNonce(String apiUrl) {
		String nonce = Long.toHexString(random.nextLong());
		this.nonces.put(nonce, new Nonce(nonce, apiUrl, true));
		return nonce;
	}
535346
function(method, url, timestamp) {
        var data = [method, url, this.options.publicKey, timestamp].join('|'),
            signature = crypto.sha256(this.options.privateKey, data);

        return signature;
    }
985456
public function checkSignature($signature = null, $timestamp = null, $nonce = null)
    {
        $request = Yii::$app->request;
        $signature === null && $signature = $request->get('signature', '');
        $timestamp === null && $timestamp = $request->get('timestamp', '');
        $nonce === null && $nonce = $request->get('nonce', '');
        $tmpArr = [$this->token, $timestamp, $nonce];
        sort($tmpArr, SORT_STRING);
        $tmpStr = implode($tmpArr);
        return sha1($tmpStr) == $signature;
    }
564780
public function signatureB($url, $key = null, $timestamp = null)
    {
        $key = $key ?: $this->getConfig()->get('cdn_key');
        $timestamp = date('YmdHi', $timestamp ?: time());

        $parsed = parse_url($url);
        $hash = md5($key.$timestamp.$parsed['path']);

        return sprintf(
            '%s://%s/%s/%s%s',
            $parsed['scheme'], $parsed['host'], $timestamp, $hash, $parsed['path']
        );
    }
134607
public function checkSignature($signature = null, $timestamp = null, $nonce = null)
    {
        $signature === null && isset($_GET['signature']) && $signature = $_GET['signature'];
        $timestamp === null && isset($_GET['timestamp']) && $timestamp = $_GET['timestamp'];
        $nonce === null && isset($_GET['nonce']) && $nonce = $_GET['nonce'];
        $tmpArr = [$this->token, $timestamp, $nonce];
        sort($tmpArr, SORT_STRING);
        $tmpStr = implode($tmpArr);
        return sha1($tmpStr) == $signature;
    }
151368
def _timestamp_handler(c, ctx):
    
    assert c in _TIMESTAMP_YEAR_DELIMITERS
    ctx.set_ion_type(IonType.TIMESTAMP)
    if len(ctx.value) != 4:
        _illegal_character(c, ctx, 'Timestamp year is %d digits; expected 4.' % (len(ctx.value),))
    prev = c
    c, self = yield
    trans = ctx.immediate_transition(self)
    state = _TimestampState.YEAR
    nxt = _DIGITS
    tokens = _TimestampTokens(ctx.value)
    val = None
    can_terminate = False
    if prev == _T:
        nxt += _VALUE_TERMINATORS
        can_terminate = True
    while True:
        is_eof = can_terminate and BufferQueue.is_eof(c)
        if c not in nxt and not is_eof:
            _illegal_character(c, ctx, 'Expected %r in state %r.' % ([_chr(x) for x in nxt], state))
        if c in _VALUE_TERMINATORS or is_eof:
            if not can_terminate:
                _illegal_character(c, ctx, 'Unexpected termination of timestamp.')
            trans = ctx.event_transition(IonThunkEvent, IonEventType.SCALAR, ctx.ion_type, _parse_timestamp(tokens))
            if c == _SLASH:
                trans = ctx.immediate_transition(_number_slash_end_handler(c, ctx, trans))
        else:
            can_terminate = False
            if c == _Z:
                # Z implies UTC, i.e. +00:00 local offset.
                tokens.transition(_TimestampState.OFF_HOUR).append(_ZERO)
                tokens.transition(_TimestampState.OFF_MINUTE).append(_ZERO)
                nxt = _VALUE_TERMINATORS
                can_terminate = True
            elif c == _T:
                nxt = _VALUE_TERMINATORS + _DIGITS
                can_terminate = True
            elif c in _TIMESTAMP_DELIMITERS:
                nxt = _DIGITS
            elif c in _DIGITS:
                if prev == _PLUS or (state > _TimestampState.MONTH and prev == _HYPHEN):
                    state = _TimestampState.OFF_HOUR
                    val = tokens.transition(state)
                    if prev == _HYPHEN:
                        val.append(prev)
                elif prev in (_TIMESTAMP_DELIMITERS + (_T,)):
                    state = _TimestampState[state + 1]
                    val = tokens.transition(state)
                    if state == _TimestampState.FRACTIONAL:
                        nxt = _DIGITS + _TIMESTAMP_OFFSET_INDICATORS
                elif prev in _DIGITS:
                    if state == _TimestampState.MONTH:
                        nxt = _TIMESTAMP_YEAR_DELIMITERS
                    elif state == _TimestampState.DAY:
                        nxt = (_T,) + _VALUE_TERMINATORS
                        can_terminate = True
                    elif state == _TimestampState.HOUR:
                        nxt = (_COLON,)
                    elif state == _TimestampState.MINUTE:
                        nxt = _TIMESTAMP_OFFSET_INDICATORS + (_COLON,)
                    elif state == _TimestampState.SECOND:
                        nxt = _TIMESTAMP_OFFSET_INDICATORS + (_DOT,)
                    elif state == _TimestampState.FRACTIONAL:
                        nxt = _DIGITS + _TIMESTAMP_OFFSET_INDICATORS
                    elif state == _TimestampState.OFF_HOUR:
                        nxt = (_COLON,)
                    elif state == _TimestampState.OFF_MINUTE:
                        nxt = _VALUE_TERMINATORS
                        can_terminate = True
                    else:
                        raise ValueError('Unknown timestamp state %r.' % (state,))
                else:
                    # Reaching this branch would be indicative of a programming error within this state machine.
                    raise ValueError('Digit following %s in timestamp state %r.' % (_chr(prev), state))
                val.append(c)
        prev = c
        c, _ = yield trans
231231
function useNonce($server_url, $timestamp, $salt)
    {
        global $Auth_OpenID_SKEW;

        // save one request to memcache when nonce obviously expired
        if (abs($timestamp - time()) > $Auth_OpenID_SKEW) {
            return false;
        }

        // returns false when nonce already exists
        // otherwise adds nonce
        return $this->connection->add(
            'openid_nonce_' . sha1($server_url) . '_' . sha1($salt),
            1, // any value here
            $this->compress,
            $Auth_OpenID_SKEW);
    }
245432
public String getLongLivedNonce(String apiUrl) {
		String nonce = Long.toHexString(random.nextLong());
		this.nonces.put(nonce, new Nonce(nonce, apiUrl, false));
		return nonce;
	}
418138
static String convertURLToString(URL url) {
		if (URISchemeType.FILE.isURL(url)) {
			final StringBuilder externalForm = new StringBuilder();
			externalForm.append(url.getPath());
			final String ref = url.getRef();
			if (!Strings.isEmpty(ref)) {
				externalForm.append("#").append(ref); //$NON-NLS-1$
			}
			return externalForm.toString();
		}
		return url.toExternalForm();
	}
940240
public function validSignature($signature, $timestamp, $nonce)
    {
        if ((null == $this->tokenString) || (empty($this->tokenString))) {
            throw new Exception("error token string");
        }

        $data = array($this->tokenString, $timestamp, $nonce);
        // use SORT_STRING rule
        sort($data, SORT_STRING);
        $validStr   = '';

        foreach ($data as $v) {
            $validStr .= $v;
        }

        $validStr = sha1($validStr);
        return ($validStr === $signature);
    }
1015696
public static Timestamp parseTimestamp(String timestamp) {
    TemporalAccessor temporalAccessor = timestampParser.parse(timestamp);
    Instant instant = Instant.from(temporalAccessor);
    return ofTimeSecondsAndNanos(instant.getEpochSecond(), instant.getNano());
  }
191958
private ResponseEntity<String> makeRestCall(String url) throws HygieiaException {
        String jiraAccess = featureSettings.getJiraCredentials();
        if (StringUtils.isEmpty(jiraAccess)) {
            return restOperations.exchange(url, HttpMethod.GET, null, String.class);
        } else {
            String jiraAccessBase64 = new String(Base64.decodeBase64(jiraAccess));
            String[] parts = jiraAccessBase64.split(":");
            if (parts.length != 2) {
                throw new HygieiaException("Invalid Jira credentials", HygieiaException.INVALID_CONFIGURATION);
            }
            return restOperations.exchange(url, HttpMethod.GET, new HttpEntity<>(createHeaders(parts[0], parts[1])), String.class);
        }
    }
883857
public void setTimeStamp(final String timeStamp)
	{

		String time = timeStamp.replace('T', ' ');
		time = time.replace('Z', ' ');

		this.timeStamp = Timestamp.valueOf(time);
	}
218113
public static String presentTimestamp(long timestamp) {
		if (timestamp == 0) {
			return UNDEF_STRING;
		}
		synchronized (TIMESTAMP_FORMAT) {
			return TIMESTAMP_FORMAT.format(new Date(timestamp));
		}
	}
12115
@SuppressWarnings("unchecked")
  public Timestamp getTimestamp(String name) {
    return ((Value<Timestamp>) getValue(name)).get();
  }
379313
public function getSignature($ticket, $nonce, $timestamp, $url, $isAdminGroup = false)
    {
        return $isAdminGroup ? sha1("group_ticket={$ticket}&noncestr={$nonce}&timestamp={$timestamp}&url={$url}") : sha1("jsapi_ticket={$ticket}&noncestr={$nonce}&timestamp={$timestamp}&url={$url}");
    }