original_string: public static function validateSignature($signature, $payload)
      {
          $parts = explode(',', $signature);
          $parameters = [];
          $t = 0;
          // Find the timestamp
          foreach ($parts as $part) {
              parse_str($part, $parsed);
              if (key($parsed) === 't') {
                  $t = $parsed['t'];
                  break;
              }
          }
  
          if ($t === 0) {
              return false;
          }
  
          $wanted = hash_hmac('sha256', $t . '.' . $payload, self::$secret);
  
          // Find v1 hashes
          foreach ($parts as $part) {
              parse_str($part, $parsed);
              if (key($parsed) === 'v1') {
                  if ($wanted === $parsed['v1']) {
                      return true;
                  }
              }
          }
  
          return false;
      }
code: public static function validateSignature($signature, $payload)
      {
          $parts = explode(',', $signature);
          $parameters = [];
          $t = 0;
          // Find the timestamp
          foreach ($parts as $part) {
              parse_str($part, $parsed);
              if (key($parsed) === 't') {
                  $t = $parsed['t'];
                  break;
              }
          }
  
          if ($t === 0) {
              return false;
          }
  
          $wanted = hash_hmac('sha256', $t . '.' . $payload, self::$secret);
  
          // Find v1 hashes
          foreach ($parts as $part) {
              parse_str($part, $parsed);
              if (key($parsed) === 'v1') {
                  if ($wanted === $parsed['v1']) {
                      return true;
                  }
              }
          }
  
          return false;
      }
code_tokens: public static function validateSignature ( $ signature , $ payload ) { $ parts = explode ( ',' , $ signature ) ; $ parameters = [ ] ; $ t = 0 ; // Find the timestamp foreach ( $ parts as $ part ) { parse_str ( $ part , $ parsed ) ; if ( key ( $ parsed ) === 't' ) { $ t = $ parsed [ 't' ] ; break ; } } if ( $ t === 0 ) { return false ; } $ wanted = hash_hmac ( 'sha256' , $ t . '.' . $ payload , self :: $ secret ) ; // Find v1 hashes foreach ( $ parts as $ part ) { parse_str ( $ part , $ parsed ) ; if ( key ( $ parsed ) === 'v1' ) { if ( $ wanted === $ parsed [ 'v1' ] ) { return true ; } } } return false ; }
docstring: Validate the webhook signature
  
  @param string $signature The string passed in header LeaseCloud-Signature
  @param string $payload   The raw payload
  
  @return bool True if the signature is valid, otherwise false
docstring_tokens: Validate the webhook signature