public static function derive(
        string $httpMethod,
        string $uri,
        string $salt,
        DateTime $date,
        $payload = '',
        int $version = 2
    ) : string {
        $httpMethod = \strtoupper($httpMethod);
        $data = self::serializePayload($payload);
        $hash = self::getSignatureHash($data, $salt, $version);
        $time = $date->format(\DateTime::RFC1123);
        $b64Salt = \base64_encode($salt);

        return "{$hash}\n{$httpMethod}+{$uri}\n{$time}\n{$b64Salt}";
    }
public static function derive(
        string $httpMethod,
        string $uri,
        string $salt,
        DateTime $date,
        $payload = '',
        int $version = 2
    ) : string {
        $httpMethod = \strtoupper($httpMethod);
        $data = self::serializePayload($payload);
        $hash = self::getSignatureHash($data, $salt, $version);
        $time = $date->format(\DateTime::RFC1123);
        $b64Salt = \base64_encode($salt);

        return "{$hash}\n{$httpMethod}+{$uri}\n{$time}\n{$b64Salt}";
    }
public static function derive ( string $ httpMethod , string $ uri , string $ salt , DateTime $ date , $ payload = '' , int $ version = 2 ) : string { $ httpMethod = \ strtoupper ( $ httpMethod ) ; $ data = self :: serializePayload ( $ payload ) ; $ hash = self :: getSignatureHash ( $ data , $ salt , $ version ) ; $ time = $ date -> format ( \ DateTime :: RFC1123 ) ; $ b64Salt = \ base64_encode ( $ salt ) ; return "{$hash}\n{$httpMethod}+{$uri}\n{$time}\n{$b64Salt}" ; }
Constructs a new signature

@param string       $httpMethod The HTTP method
@param string       $uri        The full URI with query string parameters
@param string       $salt       32 byte salt
@param DateTime     $date       The datetime object
@param array|string $payload    An array containing the data to sign
@param int          $version    The signature version to generate
Constructs a new signature