How to decode unique-id

Hi

I have followed the docs to setup the unique-id header.
The recommendation is to hex encode it as per documentation.

But how can i decode it ? I am getting errors on any hexdecode method i have tried

Thank you
Regards