How do I fix signature is invalid message when using tiktok shop api and python

I followed the "Sign your API request" page on the TikTok Shop partner website and wrote a function that generates the HMAC-SHA256 signature.
View full source