src/Octopush/Message.php
public function encrypt(array $params = [])
    {
        $requestString = '';
        $requestKey = $this->params['request_keys'];
        for ($i = 0, $n = strlen($requestKey); $i < $n; ++$i) {
            $char = $requestKey[$i];
            if (!isset($this->encryptData[$char])
              || !isset($params[$this->encryptData[$char]])) {
                continue;
            }
            $requestString .= $params[$this->encryptData[$char]];
        }

        return sha1($requestString);
    }
public function encrypt(array $params = [])
    {
        $requestString = '';
        $requestKey = $this->params['request_keys'];
        for ($i = 0, $n = strlen($requestKey); $i < $n; ++$i) {
            $char = $requestKey[$i];
            if (!isset($this->encryptData[$char])
              || !isset($params[$this->encryptData[$char]])) {
                continue;
            }
            $requestString .= $params[$this->encryptData[$char]];
        }

        return sha1($requestString);
    }
public function encrypt ( array $ params = [ ] ) { $ requestString = '' ; $ requestKey = $ this -> params [ 'request_keys' ] ; for ( $ i = 0 , $ n = strlen ( $ requestKey ) ; $ i < $ n ; ++ $ i ) { $ char = $ requestKey [ $ i ] ; if ( ! isset ( $ this -> encryptData [ $ char ] ) || ! isset ( $ params [ $ this -> encryptData [ $ char ] ] ) ) { continue ; } $ requestString .= $ params [ $ this -> encryptData [ $ char ] ] ; } return sha1 ( $ requestString ) ; }
Encoding request_sha1 	Optionnel

Cette valeur contient le sha1 de la concaténation des valeurs des champs
choisis dans la variable request_keys et concaténés dans le même
ordre que les clés.

@param  array $params the params
@return string the encrypt string code
Encoding request_sha1 Optionnel