protected function hmacsha1($key, $data) { return base64_encode(hash_hmac('SHA1', $data, $key, true)); }