I tested on wolfram alpha and rust language and the log(0xff, 0xffff), is not 2 but 0xff power 2 equals 0xffff. The result is 2.00141... Why does this happen?
I have a 4 byte number and I want to get the amount of bytes that it needs (e.g. lower than 0xff needs 1 byte, lower than 0xffff needs two bytes, etc.). I thought logarithm was the right way to solve this.