<?
	$key = "9jV7aBR9iq49A3IVprDy";
	$key_sha1 = strtoupper(sha1($key, false));
	print "key_sha1: ".$key_sha1;
	print "\n";

	$string_to_sign = "";
	$string_to_sign .= "GET\n";
	$string_to_sign .= "\n";
	$string_to_sign .= gmdate('D, d M Y H:i:s T')."\n";
	//$string_to_sign .= "Mon, 05 Jun 2023 09:12:12 GMT\n";
	$string_to_sign .= "/v2/tasks/find";

	print "\nstring to sign\n";
	print $string_to_sign;
	print "\n\n";

	$data = mb_convert_encoding($string_to_sign, mb_detect_encoding($string_to_sign), "UTF-8");
	print "\n\n\n";
	print "[data:\n";
	print $data;
	print "\n]";
	print "\n";

	$hash = hash_hmac("SHA1", $data, $key_sha1, false);
	$base64 = base64_encode(hex2bin($hash));
	print "hash: ".$hash;
	print "\n\n";
	print "base64: ".$base64."\n\n";
?>