Detailed explanation and implementation of MD5 algorithm (C language)
See the column collection for the detailed explanation and implementation of other modern cryptography algorithms~
MD5 algorithm
Algorithm process
(i) Message filling
First, fill in the message so that its length is 64 bits less than the integer multiple of 512 (these 64 bits are used to record the original data length). The filled content c ...
Posted by ziong on Wed, 23 Feb 2022 11:07:18 +0100
[C language] file operation function
[C language] file operation function
This article mainly studies the file operation functions * * fopen, fclose, fgetc, fgets, fputc, fputs, fwrite, fread, feof * *.
For the above functions, you need to import the header file stdio h
Why learn these functions? It must be because we need to store our data and put it into the hard disk for eas ...
Posted by Nicholas on Wed, 23 Feb 2022 05:38:06 +0100
Basic flow of C/S program based on TCP protocol
Server communication process
Server:
1,adopt socket()Function to create a to receive a connection request socket
2,To construct the host connection address sockaddr_in structural morphology,include sin_family,sin_port,sin_addr Three members
3,binding sockaddr_in Structure and socket
4,adopt listen()Function will stocket Set to listenin ...
Posted by mdemetri2 on Wed, 23 Feb 2022 02:59:37 +0100
typedef enum and enum usage
typedef enum {
RESET = 0,
SET = !RESET
} FlagStatus, ITStatus;
This sentence means to alias enum {reset = 0, set =! Reset}: FlagStatus and ITStatus
The FlagStatus and ITStatus that appear after this can be regarded as enum {reset = 0, set =! Reset}
The purpose of this is to save code, improve readability, and be easy to maintain~
1. De ...
Posted by tsg on Wed, 23 Feb 2022 02:21:25 +0100
Reading notes of C language programming (Chapter 12 - bit operation)
12.1 bitwise operators
C language provides six bitwise operators:
&: bitwise AND|: bitwise OR^: bitwise XOR~: reverse< <: move left>>: shift right
12.1.1 bitwise sum operation
The bitwise and operator "&" is a binocular operator. Its function is the binary phase and phase corresponding to each of the two number ...
Posted by Jem on Wed, 23 Feb 2022 02:16:08 +0100
The usage of enum in C language
brief introduction
The definition format of enumeration syntax is:
enum Enumeration name {Enumeration element 1,Enumeration element 2,......};
Let's take an example. For example, there are 7 days in a week. If you don't need to enumerate, you need to use #define to define an alias for each integer:
#define MON 1
#define TUE 2
#define WE ...
Posted by imi_99 on Tue, 22 Feb 2022 23:09:34 +0100
Reading notes of C language programming (Chapter 11 - structure and common body)
11.1 structure
11.1.1 general
Sometimes different types of data need to be combined into an organic whole for easy reference, so a structure appears. Similar to classes in high-level languages such as Java. For example, a student has attributes such as student number / name / gender / age / address:
int num;
char name[20];
char sex;
int age; ...
Posted by silvercover on Tue, 22 Feb 2022 14:26:25 +0100
c language self-study tutorial - file operation
1. Why use files
When we learned the structure earlier, we wrote the program of address book. When the address book runs, we can add and delete data to the address book. At this time, the data is stored in memory. When the program exits, the data in the address book will naturally disappear. The next time we run the address book program, t ...
Posted by mrdave on Tue, 22 Feb 2022 14:00:55 +0100
Artificial mentally retarded three piece chess
After learning arrays and functions, we can do some interesting things, such as the Gobang game mentioned in this article.
First of all, before we start to write code, we need to know what the game needs and divide the modules.
Game menuHow do players choose game modegame board How players play chessComputer chess methodHow to judge winnin ...
Posted by Zyxist on Tue, 22 Feb 2022 06:01:09 +0100
C language: preprocessing (macro definition and operator)
Preprocessing is an important function of C language, which is completed by preprocessor. When compiling a source file, the system will automatically call the preprocessing program to process the preprocessing part of the source program. After processing, it will automatically enter the compilation of the source program.
C language provides a ...
Posted by junrey on Mon, 21 Feb 2022 22:01:42 +0100