This is some code from Python:
hmac_signature = hmac.new(secret_bytes, signed_content.encode(), hashlib.sha256).digest()
expected_signature = base64.b64encode(hmac_signature).decode()
I need to convert the above exactly into PHP code. I have all the variables (secret_bytes, signed_content)
Then I need to convert the following also into PHP:
if hmac.compare_digest(signature, expected_signature):
I know how a if statement works it’s just the digest command from hmac. I need it all to be in PHP coding.
1