Один из самых удобных способов записать данные это использование готовых форматов, такие как JSON или YAML.
Из плюсов такого подхода стоит отметить вот что:
🔸 готовый, повсеместно используемый и поддерживаемый формат
🔸 простой и понятный файл, удобочитаемый для человека
🔸 можно легко редактировать в любом текстовом редакторе без специальных программ и библиотек
Но есть и минусы
🔹 затраты времени при записи файла (кодирование данных в нужный формат строки)
🔹 затраты времени при чтении файла (декодирование данных в Python объекты)
🔹 размер файла увеличивается из-за разметки данных (скобки, запятые, переносы, отступы...)
🔹 перед записью все данные должны быть помещены в память в полном объёме (не всегда)
🔹 при чтении необходимо считать весь файл в память и только потом декодировать данные
Если нужно писать немного данных в несколько файлов, то затраты по времени не ощутимы. Обычно это файлы конфига или какие-либо метаданные. Это отличный вариант под такие задачи.
Есть и другой поход к записи файлов - это бинарные файлы. Используется, когда данных достаточно много и никто их не собирается читать глазками😳.
🔸 очень быстрая запись
🔸 чтение значительно быстрей чем JSON, YAML итд
🔸 размер файла значительно меньше, так как нет разметки
🔸 можно записывать данные по мере поступления не загружая всё в память
🔸 можно извлечь любую часть данных независимо
Из минусов
🔹 нужно определить свой формат записи данных (если не используете готовую спецификацию определённого формата)
🔹 не получится открыть файл и визуально понять что там записано, а для чтения файла потребуется знать его спецификацию.
🔹 не так-то просто создать такой файл без специальной библиотеки
В таком виде удобно записывать большой массив любых однородных данных. Например, мониторинг валютной биржи или кэшированная анимация 3D геометрии.
(Это не означает что нельзя записать данные разного типа, просто это будет не так удобно)
Представьте себе JPG-картинку. По сути это немного мета-информации и большой массив пикселей. Тоже самое со звуком или видео файлом. Поэтому, если вы попробуете открыть картинку в текстовом редакторе вы увидите что-то вроде такого
f15d cd29 a564 4578 ...
09e2 9bc4 a696 1253 ...
84e9 4de1 3b23 c24a ...
2534 5161 28e0 709d ...
...
Это и есть записанные байтики. И для их чтения требуется определённый софт который знает что с ними делать. Под каждый тип файла.
К чему это я? Читайте в следующем посте...
#tricks#basic
#Hacking
🥷
Complete Ethical Hacking Bootcamp (2023)
Learn Ethical Hacking + Penetration Testing! Use real techniques by black hat hackers then learn to defend against them!
-----
Main channel: @repo_science
Coupons: @freecoupons_reposcience
-----
#hacking
🛠
Automobile Hacking and Security v2 0
Description
Have you ever thought the car you drive can also be hacked and it’s also vulnerable to hackers ?
Welcome to the second course on Automobile Hacking and Security version 2.0.
In this course we will look at some advanced and interesting concepts and see how deep the rabbit hole goes. We will start this course with the overview of the first course so all things revised and clear.
🌐En
🔗Link
-----
Main channel:@repo_science
Coupons:@freecoupons_reposcience
-----
#hacking
📊
Exclusive Hacker House Trainings
Description:
Hacker House Hands-On Hacking course is an intensive introductory course that teaches applied hacking methodologies in a hands-on practical orientated approach. Our course is engineered from decades of experienced cyber security practitioner’s knowledge to educate students on common cyber security tasks. Our course is delivered by expert hackers to prepare students on adversarial thinking and equip them for tasks conducted in a number of different cyber security roles.
🌐En
🔗Link
-----
Main channel:@repo_science
Coupons:@freecoupons_reposcience
-----
https://www.youtube.com/watch?v=3bZNhMcv4Y8
#Hacking Cars with Python
Modern cars are networks of computers, and a high end vehicle could have nearly 100 different computers inside. These devices control everything from the engine to the airbags. By understanding how these systems work, we can interface with vehicles to read data, perform diagnostics, and even modify operation.
#hacking#python
🐍
Python Hacking | Real Ethical Hacking with Python | PYCEH23+
Description:
This immersive and comprehensive course is designed to equip you with the knowledge and hands-on skills necessary to excel in the exciting world of ethical hacking.
With a focus on practical applications, this course covers everything you need to know about Python programming, making it accessible to both beginners and experienced programmers. You’ll embark on an exciting journey where you’ll learn how to harness the power of Python to manipulate MAC addresses, develop network scanners, execute Man-in-the-Middle attacks, intercept network traffic, create your own pentesting RAT (Remote Access Trojan) malware, and much more.
🌐En
🔗Link
-----
Main channel:@repo_science
Coupons:@freecoupons_reposcience
-----
#hacking#Cybersecurity
🛠
Certified in Cybersecurity 2023 – ISC2-CC Complete Training
Description
About this courseThe CC training course is designed to provide you with a detailed understanding of information security management, risk management, and incident management. The course is divided into four domains, each of which is covered in-depth:The course is designed to help you develop the necessary skills to become a successful information security manager by providing you with practical knowledge and hands-on experience.Additional NotesCourse Requirements:No requirements Certification:Upon completion of the course, you will be eligible to sit for the CC certification exam. The exam is administered by ISC2 Enroll in the CC training course today and take the first step towards becoming a certified in cybersecurity!
🌐En
⚖️1.01 GB
🔗Link
-----
Main channel:@repo_science
Coupons:@freecoupons_reposcience
-----
#hacking#Cybersecurity
📊
Cyber Security From Beginner to Expert
Description:
A beginner level comprehensive course that includes step-by-step explanations of core security concepts along with follow-up quizzes and hands on labs to ensure a solid learning for the course taker.
🌐En
🔗Link
-----
Main channel:@repo_science
Coupons:@freecoupons_reposcience
-----
#hacking#Cybersecurity
📊
Complete Cybersecurity Bootcamp
Description:
The Cybersecurity Bootcamp that will take you from ZERO to HIRED as a Cyber Security Engineer. You'll learn the latest best practices, techniques, and tools used for network security so that you can build a fortress for digital assets and prevent black hat hackers from penetrating your systems.
🌐En
🔗Link
-----
Main channel:@repo_science
Coupons:@freecoupons_reposcience
-----