3v4l.org

run code in 300+ PHP versions simultaneously
<?php $random = random_bytes(256); $message = 'hello'; $mac1 = hash_hmac('sha256', $message, $random); $mac2 = hash_hmac('sha256', $message, hash('sha256', $random, true)); var_dump($mac1, $mac2); $mac3 = hash_hmac('sha256', $random, $message); $mac4 = hash_hmac('sha256', $random, hash('sha256', $message, true)); var_dump($mac3, $mac4);

preferences:
11.17 ms | 461 KiB | 5 Q