From 6fe5dc2693a1d8378445bc17911e4bdbd08827c0 Mon Sep 17 00:00:00 2001 From: Thomas CHAZOT Date: Wed, 11 Oct 2023 11:06:38 +0200 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'README.md'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index dc7f124..6740796 100644 --- a/README.md +++ b/README.md @@ -30,3 +30,11 @@ Une fois chose faite, vous n'aurez plus qu'à convertir le fichier binaire obten Une fois ceci fait, vous n'aurez plus qu'à vous connecter à l'adresse mail de Jonathan et de vous connecter à son compte github pour récupérer et cloner le dépôt. Et voilà ! Vous pouvez maintenant admirer les photos de votre star préférée + +> Cette fonction permet de transformer du binaire en chaine de caractère. Qui sait vous pourriez en avoir besoin ;) +```python +def binary_to_string(binary_data): + binary_data=binary_data.replace('\n', '') + chaine = ''.join([chr(int(binary_data[i:i+8], 2)) for i in range(0, len(binary_data), 8)]) + return chaine +```