Cheapo Enigma machine (Robbers) For cops' post, Cheapo Enigma machine (Cops)
A robber's submission consists of a program/function that accepts the output of a cop's code and returns the input for all the outputs provided by that cop's code. (In other words, you must write the inverse function)
You cannot use built-ins that have the sole purpose of hashing or encryption.
Input/Output format
8 bits (0 or 1), or a base-10 integer in range 1-256, 0-255 or -128 to 127. Can use standard I/O or file I/O. Function can also return a value as output. Input and output must belong to the same range (as in, binary, 1-256, 0-255 or -128 to 127), which must also be the same range as that used by the cop.
Scoring
Ratio of the cop's byte count to your byte count. Highest score wins.
You can submit a robber attempt against your own cop code for reference. (Of course this code isn't eligible for winning)
Notification
Please edit the corresponding cop's answer to include your new byte count and the corresponding ratio.
JavaScript by Christoph, 8/25
f=(y,x=0)=&gt;y?f(y/2,x^y):x

(range 0-255)
Sadly, f=(y,x)=&gt;y?f(y/2,x^y):x works for all values except 0.
Technical note
We use y/2 rather than y&gt;&gt;1 to save a byte. This is abusing the fact that any value of y will eventually be rounded to 0 because of arithmetic underflow.