This shows you the differences between two versions of the page.
ic:labs:01 [2023/10/01 12:41] razvan.smadu [Codificare vs Criptare] |
ic:labs:01 [2025/02/23 13:24] (current) razvan.smadu [Laboratorul 01 - Introducere] |
||
---|---|---|---|
Line 1: | Line 1: | ||
===== Laboratorul 01 - Introducere ===== | ===== Laboratorul 01 - Introducere ===== | ||
- | Puteți lucra acest laborator folosind și platforma Google Colab, accesând [[https://colab.research.google.com/drive/1G8ycsy34UwwQqJHp2DgL5MtGERWzkhN_|acest]] link, cu excepția exercițiului bonus. Un scurt tutorial pentru utilizarea platformei poate fi găsit [[https://docs.google.com/document/d/1Dcnyv9wTfWJx8CEgnR6OgLbHAO7XD1BXGjwOAMAEmlc/edit|aici]]. | + | Puteți lucra acest laborator folosind și platforma Google Colab, accesând [[https://colab.research.google.com/github/ACS-IC-labs/IC-labs/blob/main/labs/lab01/lab1.ipynb|acest]] link, cu excepția exercițiului bonus. Un scurt tutorial pentru utilizarea platformei poate fi găsit [[https://docs.google.com/document/d/1Dcnyv9wTfWJx8CEgnR6OgLbHAO7XD1BXGjwOAMAEmlc/edit|aici]]. |
==== Python3 Crash Course ==== | ==== Python3 Crash Course ==== | ||
- | Tutorialul poate fi găsit [[ic:resurse:python|aici]]. | + | Tutorialul poate fi găsit [[ic:resurse:python|aici]]. La laboratoare vom folosi Python 3.10 sau mai nou. |
==== Codificare vs Criptare ==== | ==== Codificare vs Criptare ==== | ||
Line 262: | Line 262: | ||
Args: | Args: | ||
bytes_data (bytearray | bytes): The byte array or the byte string to be | bytes_data (bytearray | bytes): The byte array or the byte string to be | ||
- | converted. It should be encoded in UTF-8 format. | + | converted. It should be encoded in Latin-1 format. |
Returns: | Returns: | ||
str: The string representation of the byte array or the byte string, | str: The string representation of the byte array or the byte string, | ||
- | decoded using UTF-8 encoding. | + | decoded using Latin-1 encoding. |
Examples: | Examples: | ||
Line 274: | Line 274: | ||
'IC' | 'IC' | ||
""" | """ | ||
- | return bytes_data.decode(encoding="utf-8") | + | return bytes_data.decode(encoding="raw_unicode_escape") |
Line 285: | Line 285: | ||
Returns: | Returns: | ||
bytes: The byte string representation of the string, encoded using | bytes: The byte string representation of the string, encoded using | ||
- | UTF-8 encoding. | + | Latin-1 encoding. |
Examples: | Examples: | ||
Line 293: | Line 293: | ||
b'IC' | b'IC' | ||
""" | """ | ||
- | return string_data.encode(encoding="utf-8") | + | return string_data.encode(encoding="raw_unicode_escape") |
Line 306: | Line 306: | ||
Returns: | Returns: | ||
- | str: The base64 encoded string, using UTF-8 encoding. | + | str: The base64 encoded string, using Latin-1 encoding. |
Examples: | Examples: | ||
Line 325: | Line 325: | ||
Returns: | Returns: | ||
- | str: The decoded string, using UTF-8 encoding. | + | str: The decoded string, using Latin-1 encoding. |
Examples: | Examples: |