src/Service/TencentAI/Authorization.php
public function appendSignature(array $params = [], $timestamp = '', $noncestr = '')
    {
        $params += [
            'app_id' => $this->appId,
            'time_stamp' => $timestamp ? : time(),
            'nonce_str' => $noncestr ? : md5(uniqid())
        ];

        if (isset($params['app_key'])) {
            unset($params['app_key']);
        }

        ksort($params);
        $params['sign'] = strtoupper(md5(http_build_query($params + ['app_key' => $this->appKey])));

        return $params;
    }
public function appendSignature(array $params = [], $timestamp = '', $noncestr = '')
    {
        $params += [
            'app_id' => $this->appId,
            'time_stamp' => $timestamp ? : time(),
            'nonce_str' => $noncestr ? : md5(uniqid())
        ];

        if (isset($params['app_key'])) {
            unset($params['app_key']);
        }

        ksort($params);
        $params['sign'] = strtoupper(md5(http_build_query($params + ['app_key' => $this->appKey])));

        return $params;
    }
public function appendSignature ( array $ params = [ ] , $ timestamp = '' , $ noncestr = '' ) { $ params += [ 'app_id' => $ this -> appId , 'time_stamp' => $ timestamp ? : time ( ) , 'nonce_str' => $ noncestr ? : md5 ( uniqid ( ) ) ] ; if ( isset ( $ params [ 'app_key' ] ) ) { unset ( $ params [ 'app_key' ] ) ; } ksort ( $ params ) ; $ params [ 'sign' ] = strtoupper ( md5 ( http_build_query ( $ params + [ 'app_key' => $ this -> appKey ] ) ) ) ; return $ params ; }
append signature to params

@param array $params
@param $timestamp
@param $noncestr

@return array
append signature to params