Skip to content

Instantly share code, notes, and snippets.

@morganney
Last active January 3, 2016 01:59
Show Gist options
  • Save morganney/8393083 to your computer and use it in GitHub Desktop.
Save morganney/8393083 to your computer and use it in GitHub Desktop.
AWS Signature with PHP
<?php
$signature = base64_encode(hash_hmac('sha256',$string_to_sign,{AWS_ACCESS_KEY},true));
// encode any plus (+), equal (=), or other reserved characters in $signature
$signature = str_replace('%7E','~',rawurlencode($signature));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment