What is the translation sentinelhub uses to encode simga nought to unit8 from dB?

I am trying to work out how to efficiently encode the Sentinel 1 GRD sigma nought data I have downloaded. I have some data that was downloading as linear scale sigma nought (float32) and some that was downloaded as uint8 using sentinel-hubs python API.

I wanted to know how to convert between the data types but I am struggling to find the encoding process in the documentation. How does Sentinel Hub encode the data? What gain factor do they use for the uint8 encoding?