Data encoding method, data encoding device, computer equipment and storage medium

文档序号:568418 发布日期:2021-05-18 浏览:27次 中文

阅读说明:本技术 数据编码方法、装置、计算机设备和存储介质 (Data encoding method, data encoding device, computer equipment and storage medium ) 是由 夏航军 于 2020-12-30 设计创作,主要内容包括:本申请涉及数据处理技术领域,提供了一种数据编码方法、装置、计算机设备和存储介质,从所述待编码的初始数据中提取出具有第一预设字节数的第一数据;将所述第一数据转换为具有第二预设字节数的第二数据;其中,所述第二预设字节数大于所述第一预设字节数;根据基于标准的Base64编码表重新编排所得的预设Base64编码表,分别对所述第二数据中的每个字节对应的数据进行编码,得到对应的编码数据;本申请中数据转换过程中,将第一数据转换为字节数更大的第二数据,保障数据的完整性;同时,自定义Base64编码表,使得编码后的数据不容易被破解,避免数据泄露。(The application relates to the technical field of data processing, and provides a data encoding method, a data encoding device, computer equipment and a storage medium, wherein first data with a first preset byte number is extracted from initial data to be encoded; converting the first data into second data with a second preset byte number; the second preset byte number is larger than the first preset byte number; respectively coding data corresponding to each byte in the second data according to a preset Base64 coding table obtained by rearranging a standard-based Base64 coding table to obtain corresponding coded data; in the data conversion process, the first data are converted into second data with larger byte number, so that the integrity of the data is guaranteed; meanwhile, the Base64 coding table is customized, so that the coded data is not easy to crack, and data leakage is avoided.)

1. A method of encoding data, comprising the steps of:

acquiring initial data to be coded; the initial data comprises a plurality of bytes of data;

according to the sequence from front to back, sequentially extracting first data with a first preset byte number from the initial data to be coded;

converting the first data into second data with a second preset byte number; the second preset byte number is larger than the first preset byte number;

respectively encoding data corresponding to each byte in the second data according to a preset Base64 encoding table to obtain encoded data; wherein the preset Base64 encoding table is rearranged based on a standard Base64 encoding table.

2. The data encoding method of claim 1, wherein the first predetermined number of bytes is three bytes and the second predetermined number of bytes is four bytes; wherein each byte comprises 8 numbers;

the step of sequentially extracting first data with a first preset number of bytes from the initial data to be encoded according to a sequence from front to back comprises the following steps:

sequentially extracting data with three bytes from the initial bit of the initial data to be coded according to the sequence from front to back;

and sequentially combining the extracted 8 digits corresponding to each byte to obtain the first data comprising 24 digits.

3. The data encoding method of claim 2, wherein the step of converting the first data into second data having a second preset number of bytes comprises:

extracting 6 digits from 24 digits of the first data in sequence from front to back to obtain four groups of six digits;

respectively adding a preposed digit containing two preset digits before each group of six-digit digits obtained by extraction to obtain four groups of eight digits;

and taking each group of eight bytes as one byte to obtain the second data containing four bytes.

4. The data encoding method of claim 2, wherein after the step of sequentially extracting the data having three bytes from the start bit of the initial data to be encoded according to the order from front to back, the method further comprises:

and if the number of remaining bytes in the initial data to be coded is less than three bytes, using the specified character to fill in the insufficient number of bytes.

5. The data encoding method of claim 1, wherein before the step of encoding the data corresponding to each byte in the second data according to a preset Base64 encoding table to obtain the encoded data, the method further comprises:

acquiring a standard Base64 coding table; wherein, the standard Base64 coding table comprises 64 characters arranged in sequence;

acquiring a number represented by the first preset byte number, and taking the number as a preset number;

at the end of the standard Base64 coding table, sequentially extracting the preset number of characters from back to front;

and moving the extracted characters to the first position of the standard Base64 coding table according to the sequence in the standard Base64 coding table to obtain a reordered Base64 coding table as the preset Base64 coding table.

6. The data encoding method of claim 1, wherein before the step of encoding the data corresponding to each byte in the second data according to a preset Base64 encoding table to obtain the encoded data corresponding to each byte in the second data, the method further comprises:

acquiring the total byte number of the data to be arranged;

dividing the total byte number by a first preset number to obtain a division result; wherein the division result comprises a remainder;

according to the remainder, acquiring a Base64 encoding table corresponding to the remainder in a database as the preset Base64 encoding table; the database stores a Base64 coding table of first preset numbers obtained by randomly arranging the standard Base64 coding table, and a corresponding relation between each remainder and the Base64 coding table is established.

7. A data encoding apparatus, comprising:

a first obtaining unit, configured to obtain initial data to be encoded; the initial data comprises a plurality of bytes of data;

the extraction unit is used for sequentially extracting first data with a first preset byte number from the initial data to be coded according to the sequence from front to back;

the conversion unit is used for converting the first data into second data with a second preset byte number; the second preset byte number is larger than the first preset byte number;

the encoding unit is used for respectively encoding data corresponding to each byte in the second data according to a preset Base64 encoding table to obtain encoded data; wherein the preset Base64 encoding table is rearranged based on a standard Base64 encoding table.

8. The data encoding apparatus of claim 7, further comprising:

a second acquisition unit, configured to acquire a standard Base64 encoding table; wherein, the standard Base64 coding table comprises 64 characters arranged in sequence;

a third obtaining unit, configured to obtain a number corresponding to the first preset number of bytes as a preset number;

the character extraction unit is used for extracting the preset number of characters at the end of the standard Base64 coding table;

and the arranging unit is used for moving the extracted characters to the first position of the standard Base64 coding table according to the sequence in the standard Base64 coding table to obtain a reordered Base64 coding table which is used as the preset Base64 coding table.

9. A computer device comprising a memory and a processor, the memory having stored therein a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method according to any of claims 1 to 6.

10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.

Technical Field

The present application relates to the field of data processing technologies, and in particular, to a data encoding method and apparatus, a computer device, and a storage medium.

Background

The Base64 code is a character string data which can generate character string data only represented by capital and small English, numeral, plus and minus (64 characters in total) content through an algorithm. The main function of the method is to solve the problem that only ASCII characters can be used in some systems, namely, Base64 encoding is a method for converting data of non-ASCII characters into ASCII characters, and Base64 is particularly suitable for rapidly transmitting data under http, mime protocol.

However, the encoding mode of the current standard base64 is fixed, and the encoding table is also fixed, so that the risk of network transmission is increased, and the data can be cracked only by intercepting the data and decoding the data according to the corresponding decoding mode. Therefore, in order to prevent data leakage, data needs to be encrypted, but data encryption is generally time-consuming and directly affects the experience of a user on the App.

Disclosure of Invention

The present application mainly aims to provide a data encoding method, an apparatus, a computer device and a storage medium, and aims to overcome the defect that data leakage is caused by easy cracking of encoded data in the current data encoding process.

To achieve the above object, the present application provides a data encoding method, comprising the steps of:

acquiring initial data to be coded; the initial data comprises a plurality of bytes of data;

according to the sequence from front to back, sequentially extracting first data with a first preset byte number from the initial data to be coded;

converting the first data into second data with a second preset byte number; the second preset byte number is larger than the first preset byte number;

respectively encoding data corresponding to each byte in the second data according to a preset Base64 encoding table to obtain encoded data; wherein the preset Base64 encoding table is rearranged based on a standard Base64 encoding table.

Further, the first preset number of bytes is three bytes, and the second preset number of bytes is four bytes; wherein each byte comprises 8 numbers;

the step of sequentially extracting first data with a first preset number of bytes from the initial data to be encoded according to a sequence from front to back comprises the following steps:

sequentially extracting data with three bytes from the initial bit of the initial data to be coded according to the sequence from front to back;

and sequentially combining the extracted 8 digits corresponding to each byte to obtain the first data comprising 24 digits.

Further, the step of converting the first data into second data with a second preset number of bytes includes:

extracting 6 digits from 24 digits of the first data in sequence from front to back to obtain four groups of six digits;

respectively adding a preposed digit containing two preset digits before each group of six-digit digits obtained by extraction to obtain four groups of eight digits;

and taking each group of eight bytes as one byte to obtain the second data containing four bytes.

Further, after the step of sequentially extracting data having three bytes from the start bit of the initial data to be encoded according to the sequence from front to back, the method further includes:

and if the number of remaining bytes in the initial data to be coded is less than three bytes, using the specified character to fill in the insufficient number of bytes.

Further, before the step of encoding the data corresponding to each byte in the second data according to a preset Base64 encoding table to obtain encoded data, the method further includes:

acquiring a standard Base64 coding table; wherein, the standard Base64 coding table comprises 64 characters arranged in sequence;

acquiring a number represented by the first preset byte number, and taking the number as a preset number;

at the end of the standard Base64 coding table, sequentially extracting the preset number of characters from back to front;

and moving the extracted characters to the first position of the standard Base64 coding table according to the sequence in the standard Base64 coding table to obtain a reordered Base64 coding table as the preset Base64 coding table.

Further, before the step of encoding data corresponding to each byte in the second data according to a preset Base64 encoding table to obtain encoded data corresponding to each byte in the second data, the method further includes:

acquiring the total byte number of the data to be arranged;

dividing the total byte number by a first preset number to obtain a division result; wherein the division result comprises a remainder;

according to the remainder, acquiring a Base64 encoding table corresponding to the remainder in a database as the preset Base64 encoding table; the database stores a Base64 coding table of first preset numbers obtained by randomly arranging the standard Base64 coding table, and a corresponding relation between each remainder and the Base64 coding table is established.

The present application also provides a data encoding apparatus, including:

a first obtaining unit, configured to obtain initial data to be encoded; the initial data comprises a plurality of bytes of data;

the extraction unit is used for sequentially extracting first data with a first preset byte number from the initial data to be coded according to the sequence from front to back;

the conversion unit is used for converting the first data into second data with a second preset byte number; the second preset byte number is larger than the first preset byte number;

the encoding unit is used for respectively encoding data corresponding to each byte in the second data according to a preset Base64 encoding table to obtain encoded data; wherein the preset Base64 encoding table is rearranged based on a standard Base64 encoding table.

Further, still include:

a second acquisition unit, configured to acquire a standard Base64 encoding table; wherein, the standard Base64 coding table comprises 64 characters arranged in sequence;

a third obtaining unit, configured to obtain a number corresponding to the first preset number of bytes as a preset number;

the character extraction unit is used for extracting the preset number of characters at the end of the standard Base64 coding table;

and the arranging unit is used for moving the extracted characters to the first position of the standard Base64 coding table according to the sequence in the standard Base64 coding table to obtain a reordered Base64 coding table which is used as the preset Base64 coding table.

The present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.

The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the method of any of the above.

According to the data encoding method, the data encoding device, the computer equipment and the storage medium, first data with a first preset byte number are extracted from the initial data to be encoded; converting the first data into second data with a second preset byte number; the second preset byte number is larger than the first preset byte number; respectively coding data corresponding to each byte in the second data according to a preset Base64 coding table obtained by rearranging a standard-based Base64 coding table to obtain coded data; in the data conversion process, the first data are converted into second data with larger byte number, so that the integrity of the data is guaranteed; meanwhile, the Base64 coding table is customized, so that the coded data is not easy to crack, and data leakage is avoided.

Drawings

FIG. 1 is a schematic diagram illustrating steps of a data encoding method according to an embodiment of the present application;

FIG. 2 is a block diagram of a data encoding apparatus according to an embodiment of the present application;

fig. 3 is a block diagram illustrating a structure of a computer device according to an embodiment of the present application.

The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.

Detailed Description

In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.

Referring to fig. 1, an embodiment of the present application provides a data encoding method, including the following steps:

step S1, acquiring initial data to be coded; the initial data comprises a plurality of bytes of data;

step S2, extracting first data with a first preset byte number from the initial data to be coded in sequence according to the sequence from front to back;

step S3, converting the first data into second data with a second preset byte number; the second preset byte number is larger than the first preset byte number;

step S4, respectively encoding data corresponding to each byte in the second data according to a preset Base64 encoding table to obtain encoded data; wherein the preset Base64 encoding table is rearranged based on a standard Base64 encoding table.

In this embodiment, the data encoding method is used for performing custom encoding on data, and the method in this embodiment not only realizes encoding on data, but also encrypts the data to a certain degree, thereby ensuring the integrity of the received data and the safety of the data.

Specifically, as described in step S1 above, the initial data to be encoded is data before encoding, and the initial data is usually inconvenient to be directly transmitted, such as data leakage caused by directly transmitting. Therefore, it is necessary to perform data transmission after performing encoding processing. The initial data includes a plurality of bytes, and each byte includes 8-bit data, i.e. 8 numbers.

As stated in step S2, sequentially extracting data with a first preset number of bytes from the initial data to be encoded according to the sequence from front to back in the data to be encoded to form a group of first data; that is, a specified number of bytes of data is extracted from the initial data to be encoded, for example, three bytes of data may be extracted to constitute the first data.

As described in the above step S3, the first data is converted into the second data, and the byte number of the second data is greater than the byte number of the first data, so that not only all information of the first data can be included in the second data to ensure the integrity of the data, but also the first data is different from the second data, which is equivalent to a simple data conversion process, thereby improving the security of the data. For example, in one embodiment, three bytes of first data may be converted to four bytes of second data; alternatively, the first data of two bytes is converted into the second data of four bytes.

As described in step S4, when the second data is obtained and the second data includes a second predetermined number of bytes of data, and the second predetermined number of bytes of data are encoded, the encoded data corresponding to each byte in the second data is obtained. The data encoding process is realized, which is equivalent to the data encryption process, so that data leakage is avoided, and the data security is improved. And combining the coded data corresponding to each byte in the second data to obtain third data, namely the coded data of the first data, and combining the coded data of each first data to obtain the coded data of the initial data.

It is understood that, in the embodiment, when the second data is encoded, the preset Base64 encoding table is rearranged based on the standard Base64 encoding table; the standard Base64 coding table is 64 characters A-Z, a-Z, 0-9, +,/and the like, namely the preset Base64 coding table is also coded by using 64 characters; however, the character sequence in the coding table is different from that of the standard Base64 coding table, the 64 characters can be completely scrambled, even the 64 characters can be replaced, and other users cannot decode to obtain data by using the standard Base64 coding table. The data before encoding can be obtained by decoding after the preset Base64 encoding table in the embodiment is acquired. In this embodiment, the data encoding process is adopted to not only ensure the integrity of the data, but also improve the security of the data and prevent the data from being easily stolen and cracked.

In an embodiment, the first preset number of bytes is three bytes, and the second preset number of bytes is four bytes; wherein each byte comprises 8 numbers;

the step S2 of sequentially extracting first data with a first preset number of bytes from the initial data to be encoded according to a sequence from front to back includes:

step S21, sequentially extracting data with three bytes from the start bit of the initial data to be encoded according to the sequence from front to back;

step S22, sequentially combining the 8 numbers corresponding to each extracted byte to obtain the first data including 24 numbers.

In the present embodiment, three bytes of data are extracted from the original data to be encoded at a time, and each byte of data includes 8 numbers. For example, the extracted three bytes include numbers 01234567, and 01234567, respectively, and the numbers included in the three bytes are sequentially combined to obtain the first data. The sequential combination refers to combining numbers included in the three bytes in the original order of the three bytes in the initial data, for example, 012345670123456701234567 is obtained as the first data after sequential combination. The first data includes 3 × 8 ═ 24 digits.

In an embodiment, the step S3 of converting the first data into second data with a second preset number of bytes includes:

step S31, sequentially extracting 6 digits from the 24 digits of the first data from front to back to obtain four groups of six digits;

step S32, adding a number containing two preset numbers before each group of six-digit numbers are extracted to obtain four groups of eight-digit numbers;

step S33, using each group of octets as a byte, obtaining the second data containing four bytes.

In the embodiment, the first data is converted into the second data, and the byte number of the second data is converted from three to four; it is understood that 24 digits included in the first data are allocated to four bytes, and each converted byte includes 6 digits in the first data; since each byte requires 8 digits, two digits, namely the prefix digit, need to be added, and in order not to affect the correct expression of the data, the prefix digit is usually "00"; in this embodiment, the numbers corresponding to the four bytes obtained through the conversion are 00012345, 00670123, 00456701 and 00234567; the second data obtained by the above conversion is 00012345006701230045670100234567. In other embodiments, the distribution may not be the average distribution, for example, the converted four bytes sequentially include 7, and 3 digits in the first data, or the converted four bytes sequentially include 7, 5, and 5 digits in the first data, which is not described herein again.

In an embodiment, after the step S21 of sequentially extracting data having three bytes from the start bit of the initial data to be encoded according to the order from front to back, the method further includes:

step S2a, if the remaining number of bytes in the initial data to be encoded is less than three bytes, using the specified character to fill in the insufficient number of bytes.

In this embodiment, if the number of bytes remaining in the initial data to be encoded is less than three bytes, for example, only one byte or two bytes remain, the initial data to be encoded may be padded with a designated character, which may be "═ as a padding character.

In an embodiment, before the step S4 of encoding the data corresponding to each byte in the second data according to a preset Base64 encoding table to obtain encoded data, the method further includes:

step S41, acquiring a standard Base64 coding table; wherein, the standard Base64 coding table comprises 64 characters arranged in sequence;

step S42, acquiring a number represented by the first preset number of bytes, and taking the number as a preset number;

step S43, at the end of the standard Base64 coding table, extracting the preset number of characters from back to front in sequence;

and step S44, moving the extracted characters to the first position of the standard Base64 coding table according to the sequence in the standard Base64 coding table to obtain a reordered Base64 coding table as the preset Base64 coding table.

In this embodiment, when the standard Base64 encoding table is rearranged, only a few characters at the end of the standard Base64 encoding table need to be moved to the first position of the standard Base64 encoding table, so that the sequence in the standard Base64 encoding table can be disturbed. Meanwhile, in order to record the above arrangement rule, in this embodiment, the number of last characters of the extracted standard Base64 encoding table is the same as the number corresponding to the first preset byte number, for example, if the number corresponding to the first preset byte number is 3, then 3 last characters of the extracted standard Base64 encoding table are moved to the front end of the standard Base64 encoding table. This makes it possible to associate said arrangement rule with said first predetermined number of bytes, i.e. so that only one digit has to be memorized, without the need to record complex arrangement rules.

In an embodiment, before the step S4 of encoding the data corresponding to each byte in the second data according to a preset Base64 encoding table to obtain the encoded data corresponding to each byte in the second data, the method further includes:

step S401, acquiring the total byte number of the data to be arranged;

step S402, dividing the total byte number by a first preset number to obtain a division result; wherein the division result comprises a remainder;

step S403, according to the remainder, obtaining a Base64 encoding table corresponding to the remainder from a database as the preset Base64 encoding table; the database stores a Base64 coding table of first preset numbers obtained by randomly arranging the standard Base64 coding table, and a corresponding relation between each remainder and the Base64 coding table is established.

In this embodiment, the Base64 encoding table of the above standard is randomly arranged in advance to obtain a Base64 encoding table of a first preset number. For example, if the first predetermined number is 3, then 3 Base64 code tables are obtained. Meanwhile, when the first preset number is used as the denominator, the obtained remainder is 0, 1 … … N, wherein N is the subtraction of 1 from the first preset number; for example, if the first predetermined number is 3, the remainder is 0, 1, 2. And establishing the corresponding relation between the remainder and the Base64 coding table, namely that the remainders 0, 1 and 2 respectively correspond to different Base64 coding tables.

When the preset Base64 coding table is obtained, the preset Base64 coding table can be obtained according to the remainder by obtaining the total byte number of the data to be arranged and dividing the total byte number by the first preset number to obtain the remainder. That is, in the present embodiment, the data with different byte numbers and the adopted preset Base64 encoding table are also different; the decoding difficulty is increased, and the data leakage is avoided.

In an embodiment, the data encoding method further includes:

and storing the preset Base64 encoding table, the initial data and the third data in a block chain. The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product services layer, and an application services layer.

Referring to fig. 2, an embodiment of the present application further provides a data encoding apparatus, including:

a first obtaining unit 10, configured to obtain initial data to be encoded; the initial data comprises a plurality of bytes of data;

an extracting unit 20, configured to extract, according to a sequence from front to back, first data with a first preset number of bytes from the initial data to be encoded in sequence;

a conversion unit 30, configured to convert the first data into second data with a second preset number of bytes; the second preset byte number is larger than the first preset byte number;

the encoding unit 40 is configured to encode data corresponding to each byte in the second data according to a preset Base64 encoding table, to obtain encoded data; wherein the preset Base64 encoding table is rearranged based on a standard Base64 encoding table.

In an embodiment, the data encoding apparatus further includes:

a second acquisition unit, configured to acquire a standard Base64 encoding table; wherein, the standard Base64 coding table comprises 64 characters arranged in sequence;

a third obtaining unit, configured to obtain a number represented by the first preset number of bytes, and use the number as a preset number;

the character extraction unit is used for sequentially extracting the preset number of characters from back to front at the end of the standard Base64 coding table;

and the arranging unit is used for moving the extracted characters to the first position of the standard Base64 coding table according to the sequence in the standard Base64 coding table to obtain a reordered Base64 coding table which is used as the preset Base64 coding table.

In an embodiment, the data encoding apparatus further includes:

a fourth obtaining unit, configured to obtain a total number of bytes of the data to be arranged;

the dividing unit is used for dividing the total byte number by a first preset number to obtain a dividing result; wherein the division result comprises a remainder;

a fifth obtaining unit, configured to obtain, according to the remainder, a Base64 encoding table corresponding to the remainder in a database as the preset Base64 encoding table; the database stores a Base64 coding table of first preset numbers obtained by randomly arranging the standard Base64 coding table, and a corresponding relation between each remainder and the Base64 coding table is established.

In an embodiment, the first preset number of bytes is three bytes, and the second preset number of bytes is four bytes; wherein each byte comprises 8 numbers;

the extraction unit 20 is specifically configured to:

sequentially extracting data with three bytes from the initial bit of the initial data to be coded according to the sequence from front to back;

and sequentially combining the extracted 8 digits corresponding to each byte to obtain the first data comprising 24 digits.

In an embodiment, the conversion unit 30 is specifically configured to:

extracting 6 digits from 24 digits of the first data in sequence from front to back to obtain four groups of six digits;

respectively adding a preposed digit containing two preset digits before each group of six-digit digits obtained by extraction to obtain four groups of eight digits;

and taking each group of eight bytes as one byte to obtain the second data containing four bytes.

In an embodiment, the extracting unit 20 is further configured to:

and if the number of remaining bytes in the initial data to be coded is less than three bytes, using the specified character to fill in the insufficient number of bytes.

In this embodiment, please refer to the method described in the above embodiment for a specific implementation manner of each unit in the above apparatus embodiment, which is not described herein again.

Referring to fig. 3, a computer device, which may be a server and whose internal structure may be as shown in fig. 3, is also provided in the embodiment of the present application. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer designed processor is used to provide computational and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing code tables and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a data encoding method.

Those skilled in the art will appreciate that the architecture shown in fig. 3 is only a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects may be applied.

An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements a data encoding method. It is to be understood that the computer-readable storage medium in the present embodiment may be a volatile-readable storage medium or a non-volatile-readable storage medium.

In summary, for the data encoding method, apparatus, computer device and storage medium provided in this embodiment of the present application, first data with a first preset number of bytes is extracted from the initial data to be encoded; converting the first data into second data with a second preset byte number; the second preset byte number is larger than the first preset byte number; respectively coding data corresponding to each byte in the second data according to a preset Base64 coding table obtained by rearranging a standard-based Base64 coding table to obtain corresponding coded data; in the data conversion process, the first data are converted into second data with larger byte number, so that the integrity of the data is guaranteed; meanwhile, the Base64 coding table is customized, so that the coded data is not easy to crack, and data leakage is avoided.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium provided herein and used in the examples may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double-rate SDRAM (SSRSDRAM), Enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.

The above description is only for the preferred embodiment of the present application and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are intended to be included within the scope of the present application.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于哈希函数的藏文排序方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!