A
A
alexrett2014-09-20 20:13:19
PHP
alexrett, 2014-09-20 20:13:19

Python hmac is there an alternative in php?

There is such an algorithm in Python:

sign = hmac.new(str(secret_key))
sign.update(project_id)
sign.update(user)
token = sign.hexdigest()
print token

It seems clear from the php documentation that hash_hmac should return the desired result, but the hashes are different ..
The algorithm is most likely md5, judging by the python documentation, but I can’t get the same hashes.
Is there a way to make php generate the same hash as in python?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question