the coding structure of commodity bar code includes the standard version of commodity bar code (ean-13 barcode) and the shortened version of commodity bar code (ean-8 barcode). Standard Edition commodity bar code: EAN-13 Standard Edition commodity bar code's Structure Standard Edition commodity bar code's code consists of 13 digits, and its structure is as follows: Structure 1: X13x1x1X9x87x5x5x3x2x1, in which: X13 ... x7 manufacturer identification code; X6 ..... x2 represents the product project code; X1 check code. Structure 2: X13x12x1x1 x9x87x6 x5x4x3x2x1. Where: X13 ... X6 vendor identification code; X5 ..... x2 represents the product project code; X1 check code. When X13X12X11 is 69 and 691, its code structure is the same as structure 1; When X13X12X11 is 692, its code structure is the same as structure 2. Check code calculation refers to the method specified in GB 1294 "General commodity bar code" national standard. Shortened version of commodity bar code: EAN-8 shortened version of commodity bar code consists of 8 digits, and its structure is as follows: x8x7x6x5x3x2x1; In which: X8X7 X6: its meaning is the same as X13X12X11; of the standard version of commodity bar code; X5X4X3X2: indicates the code of commodity project, which is uniformly distributed by EAN coding organization. In China, it is uniformly distributed by China Article Coding Center; X1: check code. When calculating, you need to add five zeros before the shortened version of commodity bar code code, and then calculate according to the calculation method of standard version of commodity bar code check code.
References:: zhsy ../knowledge/changshi4.htm Code 69 123456789X Find the VB program of the following algorithm 1. Serial number sequence from right to left, The serial number of the check code is 1 2. From the serial number 2, the sum of even digits is 19+7+5+3+1+9 = 34 13. ① * 3 = 234× 3 = 12 24. From the serial number 3, the sum of odd digits is 38+6+4+2++6 = 26 ③ 5.②+③ =
I only know. The last bit is the parity code. As for how to get it, please see:
the algorithm of the check code of ean-13 code is the same as UPC-A code. For example, suppose that the codes of an EAN-13 code are as follows:
n1n2n3 n4n5n6 n7 n8 n9n1n1n12c
The calculation steps of the check code are as follows:
C1 = n1+n3+n5+n7+n9+n11
C2 = (N2+n4+n6+n8. × 3
CC = (C1+C2) take single digits
C (check code) = 1-CC (if the value is 1, take )
Calculation method of check code
1. Code position number
Code position number refers to the sequence number from right to left (check code)
2. Calculation steps
The calculation steps of the check code are as follows:
a. Starting from the code position number 2, the digital codes of all even digits are summed.
B. multiply the sum of step a by 3.
C. starting from code position number 3, sum all odd-numbered digital codes.
D. add the results of step b and step c.
e. subtract the result obtained in step d with a number greater than or equal to the result obtained in step d and the minimum integer multiple of 1, and the difference is the value of the check code.
calculation method of 8421 code
bcd code, also called 8421 code, is to expand the decimal number into binary system in the form of 8421. As we all know, decimal system is composed of ~ 9 arrays. Each of these ten numbers has its own 8421 code: = 1 = 1 2 = 1 3 = 11 4 = 1 5 = 11 6 = 11 7 = 111 8 = 1 9 = 11. For example, the 8421 code of 321 is 321 11 1 1. = 31 = 8x+4x+2x1+1x = 2. 1 = 8x+4x+2x+1x1 = 1 Specific: bcd code is a four-bit binary code, that is, it converts decimal numbers into binary, but it is a little different from ordinary conversion, and each decimal number -9 corresponds to one. Decimal 1 corresponds to binary 1.9.11, and the next 1 are represented by two of the above codes, that is, BCD code generates carry when it meets 11, unlike ordinary binary code, which does not generate carry 1 CRC code until 1111. Calculation method
1. Loop check code (CRC code): It is the most commonly used error check code in the field of data communication, and its characteristic is information.
2. Basic principle of generating CRC code: Any code composed of binary bit strings can correspond to a polynomial whose coefficients are only' ' and' 1'. For example, the polynomial corresponding to code 11111 is x6+x4+x2+x+1, and the polynomial is x5+x3+x2+x+1 corresponding to code 11111.
3. Principles of CRC code set selection: If the codeword length is n, the information field is k bits, and the check field is r bits (N=K+R), there is only one polynomial g(x) of degree r for any codeword in the CRC code set, so that
v (x) = a (x) g (x) = xrr.
where: m(x) is an information polynomial of degree k, r(x) is a check polynomial of degree R-1, and
g(x) is called a generator polynomial:
g(x) = G+g1x+g2x2+...+g (r-1) x (r-1).
The standard CRC generator polynomial is as follows:
Abbreviation of name generator polynomial * Standard reference
CRC-4x4+X+13ITU G.74
CRC-8x8+X5+X4+1x31
CRC-8x8+X2+X1+1x7
CRC-8x8+X6+X4+X3+X2+X1. > CRC-16 x16+x15+x2+1 85 IBM SDLC
CRC16-CCITT x16+x12+x5+1 121 ISO HDLC, ITU X.25, V.34/V.41/V.42, PPP-FCS
CRC-32 x32+x26+x23+...+x2+x+1 4C11DB7 ZIP, RAR, IEEE 82 LAN/FDDI, IEEE 1394, PPP-FCS
CRC-32cx32+x28+x27+...+x8+x6+11edc6f41sctp
Basic algorithm (manual calculation):
Take CRC16-CCITT as an example to explain, the CRC check code is 16 bits, and the generated polynomial is 17 bits. If the data stream is 4 bytes: BYTE[3], BYTE[2], BYTE[1], byte [];
the data stream is shifted to the left by 16 bits, which is equivalent to expanding by 256×256 times, and then divided by the generating polynomial x1121, and the division operation without borrowing bits (equivalent to bitwise XOR) is performed, and the remainder obtained is the CRC check code.
the data stream during transmission is 6 bytes: BYTE[3], BYTE[2], BYTE[1], BYTE[], CRC[1], CRC [];
for example:
the information field code is: m(x)=x6+x4+x3+1; the code is: 1111
the generator polynomial is: g(x)=x4+x3+1; the code is: 111
m(x) x4 = X1+. X4 is performing modulo-2 division with g(x), which is equivalent to bitwise XOR. The calculation process is as follows:
1111
111
-------
1111
111. ----
1 1 1 1
1 1 1
-----------------------------
1 1 1
1 1 1
-----------------------------
1 1 --------------> The remainder is the calculation method of check code ASCII code
ASCII code is stipulated by Americans, and there is only one conversion table from characters to codes. For example, the character "" is 48, the character "a" is 97, and so on. Just remember a few initial letters, and you can calculate the ASCII code of other characters accordingly. You can easily calculate that the ASCII code of the character "9" is 57. All the above are decimal. RAS password calculation method
The security of RSA depends on the decomposition of large numbers. Both the public key and the private key are functions of two large prime numbers
(more than 1 decimal places). It is speculated that the difficulty of inferring plaintext from a key and ciphertext
is equivalent to decomposing the product of two large prime numbers.
key pair generation: choose two big prime numbers, p and q. Calculation:
n = p * q
Then the encryption key E is randomly selected, which requires that E and (p-1) * (q-1 )
are mutually prime. Finally, the decryption key d is calculated by Euclid algorithm, which satisfies
e * d = 1 (mod (p-1) * (q-1) )
where n and d are also coprime. Numbers e and
n are public keys and d is private key. Two prime numbers, p and q, are no longer needed and should be discarded, so that no one can know. When encrypting information M (binary representation), firstly, M is divided into data blocks m1 ,m2,..., mi with block length s, where 2 s <: = n, s is as big as possible. The ciphertext corresponding to
is:
ci = mi e (mod n) (a)
The following calculation is made when decrypting:
mi = ci d (mod n) (b) Calculation method of payroll: the daily wage is converted according to the average monthly paid days of 21.75 days, and the hourly wage is divided by 8 hours on the basis of the daily wage. That is, the calculation method of daily overtime pay during the Spring Festival holiday is:
holiday overtime pay = calculation base of overtime pay ÷21.75×3%
rest day overtime pay = calculation base of overtime pay ÷21.75×2%
monthly salary: Man Qin monthly basic salary = monthly standard salary
basic salary of absence month = month. Days of absence
overtime pay: delay = monthly standard pay /21.75/8* overtime hours *1.5
rest days = monthly standard pay /21.75/8* overtime hours *2
holidays = monthly standard pay /21.75/8* overtime hours *3 calculation method
2) ÷ 2
(1+1/2-1/19-1/2) ÷ 2
= 531/38 ÷ 2
= 531/76
15 times a quarter.