How does the decode function work (Legacy KB ID CNC TS12283 )