What best practices should be followed when writing a dynamic signature script in PHP for a livestream service like Hitbox.tv?

When writing a dynamic signature script in PHP for a livestream service like Hitbox.tv, it is important to securely generate the signature by using a combination of the stream key, timestamp, and secret key. This ensures that only authorized requests are accepted by the service. Additionally, it is recommended to use secure hashing algorithms like SHA-256 to generate the signature.

<?php
$streamKey = 'YOUR_STREAM_KEY';
$secretKey = 'YOUR_SECRET_KEY';
$timestamp = time();

$signature = hash('sha256', $streamKey . $timestamp . $secretKey);

echo $signature;
?>