Base64 Code Description
The BASE64 encoding requires the conversion of 3 8-bit bytes (3*8=24) into 4 6-bit bytes (4*6=24), followed by 6 two in front of 0 bits, forming a 8-bit byte form.
If the remaining characters are less than 3 bytes, then 0 is populated with the output character using ' = ', so there may be 1 or 2 ' = ' At the end of the encoded text output.
To ensure the output of the encoded bit-readable characters, BASE64 developed an encoding table for uniform conversion.
The size of the encoded table is 2^6=64, which is also the origin of the Base64 name.
" abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789+/ "; //
Prototype: extern int isalnum (int c); Function: Determine if the character variable C is a letter or a numeric description: When C is a number 0-9 or letter A-Z and a-Z, returns a value other than 0, otherwise returns zero.
#include <syslib.h>/*<ctype.h> included*/#include<ctype.h>/*<ctype.h> included*/Main ()/*"main" function*/{ intC/*integer C;*/CLRSCR (); //Clear Screen () foreign language full name plus abbreviation: Clear screensC='a';/*assigning values to variables*/printf ("%c:%s\n", C,isalnum (c)?"Yes":"No");/*"Format output" (Foreign language full name plus abbreviation: printf)*/C='7';/*assigning values to variables*/printf ("%c:%s\n", C,isalnum (c)?"Yes":"No"); C='@';/*assigning values to variables*/printf ("%c:%s\n", C,isalnum (c)?"Yes":"No"); GetChar ();/*gets the character ();*/ return 0;/*returns 0; normal exit*/}
Base64 Code Description