<?php	
	
	function printo_stderr($message) 
	{
		global $STDERR;
		if (! $STDERR) {
			$STDERR = fopen('php://stderr', 'w+');
		}
		fwrite($STDERR, "$message\n");
	}
	
	function getSignature($operation, $email, $secretKey)
	{
		date_default_timezone_set('UTC');
		
		//A full numeric representation of a year, 4 digits
		$year = date("Y");
		
		//Numeric representation of a month, without leading zeros
		$month = date("n");
		
		//Day of the month without leading zeros
		$day = date("j");
		
		//24-hour format of an hour without leading zeros
		$hour = date("G");
		
		$signature = md5($operation . $year . $month . $day . $hour . $email . $secretKey);
		
		return $signature;
	}

?>
