Generation

generate functionTue, 17 Jan 2023

Алгоритм шифрования штатной сигнализации Nissan Almera

typedef unsigned int uint16; uint16 GetKey(uint16 code) { uint16 key = 0xAA; for(uint16 i = 0; i < 16; i++) { if(code >> i & 1) key = ((key >> 1) | 0x80) + ((key & 1) << 3) + (key & 2) + (key & 4); else key = ((key & 0x80) >> 3) + ((key & 1) << 1) + (key >> 1) + (key & 2) + (key & 4); } return key; }

Questions about programming?Chat with your personal AI assistant