The key property of an encoding function is that it must be
"one-to-one"
meaning
No two distinct domain elements can encode to the same range element.
i.e.
If f(x) = f(y) then x = y.
The reason is to allow decoding of f(x) into x.