Skip to content

Instantly share code, notes, and snippets.

@yne
Created August 18, 2024 16:14
Show Gist options
  • Save yne/d6dad90416727c2e027774857233524f to your computer and use it in GitHub Desktop.
Save yne/d6dad90416727c2e027774857233524f to your computer and use it in GitHub Desktop.
Renault Car Radio Unlock Code Generator
/*
Generate Unlock Code for Clio, Duster, Espace, Kangoo, Laguna, Logan, Master, Megane, Safrane, Scenic, Symbol, Trafic, Twingo
Using the PRE code (1 letter, 3 numbers) which can either be found
- by turning on the radio and simultaneously press the buttons “1” and “6” for about five seconds
- by extracting the radio from it slot and looking bellow the barcode sticker
*/
function renault(a, b, c, d) { // 'A', 1, 0, 0
left = (a.charCodeAt(0) - 65) * 10 + b;
right = ((left + c * 10 + d) * 7) % 100;
return String((259 % Math.abs(left)) % 100).padStart(2, 0) + (right % 10) + (right / 10 | 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment