Reputation: 61
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?
Upvotes: 0
Views: 107
Reputation: 7035
Do you really want to add these together or to you want to concatenate them?
// Adding
$signature = md5($key + $secret + $timestamped);
// Concatenating
$signature = md5($key . $secret . $timestamped);
Upvotes: 1
Reputation: 21272
Maybe you want to use .
(concatenation) instead of +
(sum)
$signature = md5($key . $secret . $timestamped);
Upvotes: 3
Reputation: 20873
I think you mean to concatenate the strings with .
instead of add numerically with +
.
$signature = md5($key . $secret . $timestamped);
Upvotes: 2