Feb-18-2019, 01:46 PM
on python:
I try convert code from php to python.
Test on python versions: 3.6.6, 3.5.4 and php: 7.0.30
import hashlib import hmac hmac.new(b'abc', b'skey', hashlib.sha256).hexdigest() return: '24fd94ffa1f3e4c62376205b715a9193b67b568731b1c1f661fd1c1bc717e469'but in php:
Output:hash_hmac('sha256', 'abc', 'skey')
return: 'ee6177854ca54cfcc49f1bf44256eefc0f9f3fb197c9af9ddf821fa4282b5906'
Why it is different?I try convert code from php to python.
Test on python versions: 3.6.6, 3.5.4 and php: 7.0.30