func decodeInt(from []byte, base int) (x, used int) { switch { case base < 2: base = 2 case base > 255: base = 255 } var ( div = uint(base) cut = byte(256 - base) num = uint(0) mul = uint(1) ) for i, from := range from { num += uint(from) * mul if from < cut { x = int(num >> 1) if num&1 != 0 { x = ^x } used = i return } mul *= div } return }
To receive a hint, submit unfixed code.