def compare_signature(expected: Union[str, bytes],<EOL>actual: Union[str, bytes]) -> bool:
expected = util.to_bytes(expected)<EOL>actual = util.to_bytes(actual)<EOL>return hmac.compare_digest(expected, actual)<EOL>
Compares the given signatures.

:param expected: The expected signature.
:type expected: Union[str, bytes]
:param actual: The actual signature.
:type actual: Union[str, bytes]
:return: Do the signatures match?
:rtype: bool