for n=0to 254k=n:r=0:while(k>=1)r=2*r+and(k,1):k=k/2wend:?xor(n,r)next