I have an unique identifier (uid) x
, and given an integer j
, I need a function f
such that f(x, j)
is another uid (in the same "domain" as x
) such that f(x, j1) = f(x, j2)
if and only if j1 = j2
and f(x, j) != x
for any j
.
A naive way to do this is to maintain x
as a tuple (i1, i2, ..., ik)
and define f(x, j) = (j, i1, i2, ..., ik)
. Is there a better, more efficient way to do this? I am specifically looking for python solutions.
Edit: I also need f(x1, j1) = f(x2, j2)
if and only if x1 = x2
and j1 = j2