使用 php 生成签名时出现问题
现有的 API 出了点小问题,在我承认它已损坏但我没有损坏之前,我想有人可能会看到我做错了什么。
这就是他们要求作为 url 一部分的内容 - 由以下内容形成的签名: 十六进制编码的MD5(密钥+秘密+时间戳)
这就是我给他们的失败的东西:
$key = 'xxxxxxxxxxxxxxxxxx';
$secret = 'DeMxxxxxxxxxw';
$timestamped = $_SERVER['REQUEST_TIME'];
$signature = md5($key + $secret + $timestamped);
那么我做错了什么或者他们没有很好地玩我?
Having a little problem with an API that's out there and before I admit that it's broken and i'm not - figured someone might see what i'm doing wrong.
This is what they are asking for as part of the url - a signature that is formed by this:
hex-encoded MD5(key + secret + timestamp)
And this is what i'm giving them that's failing:
$key = 'xxxxxxxxxxxxxxxxxx';
$secret = 'DeMxxxxxxxxxw';
$timestamped = $_SERVER['REQUEST_TIME'];
$signature = md5($key + $secret + $timestamped);
So am I doing something wrong or are they not playing with me well?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
也许您想使用
.
(串联)而不是+
(总和)Maybe you want to use
.
(concatenation) instead of+
(sum)我认为您的意思是用
.
连接字符串,而不是用+
进行数字添加。$signature = md5($key . $secret . $timestamped);
I think you mean to concatenate the strings with
.
instead of add numerically with+
.$signature = md5($key . $secret . $timestamped);
PHP 中的连接运算符是“.”,而不是“+”
the concatenation operator in PHP is '.', not '+'
您真的想将它们添加在一起还是想将它们连接起来?
Do you really want to add these together or to you want to concatenate them?