質問

I'm using sha256 on my hash, but when i include google api php client https://code.google.com/p/google-api-php-client/, somehow my hash is changed

so

include 'google-api-php-client.php';
$my_hash = hash('sha256', $my_salted_data);

will produce different result from

$my_hash = hash('sha256', $my_salted_data);

Do you guys know what happened?

役に立ちましたか?

解決

I found what the problem is, After I see Google API PHP Client source code, i found that the script will set default timezone to UTC if not defined in php.ini and my hash algorithm use date function using different timezone, so my hash will produce different result

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top