A random number generation method, device and application, equipment and storage medium
A random number and random selection technology, applied in the blockchain field, can solve problems such as security threats, failure to maintain node information consistency, blockchain network business impact, etc., to achieve the effect of ensuring randomness and consistency
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0035] This embodiment relates to a random number generation method, such as figure 1 shown, including:
[0036] S101. Concatenate the transactions in the consecutive N blocks before the current block to form content C;
[0037] S102, the content C is divided into fragments of M bytes, the total number of fragments S=len(C) / M;
[0038] S103, whether len(C)>S*M is true, if so, then S=S+1; if not, then the S value remains unchanged;
[0039] S105. Obtain the fragmented content from the content C according to the fragmented index Indexi, and calculate a random number by performing a hash operation on the fragmented content.
[0040] Among them, N≥1, M and N are both integers, the value range of M: len(C)≥M≥32, M is a power of 2
[0041] A further improvement is that there are many methods for randomly determining a fragment index from the S fragments, which can be determined according to needs. The present embodiment enumerates three methods including:
[0042] Method 1: Frag...
Embodiment 3
[0081] An apparatus comprising: one or more processors; memory for storing one or more programs which, when executed by the one or more processors, cause the One or more processors execute the method as described above.
[0082] A storage medium storing a computer program, when the program is executed by a processor, implements the method described in Embodiment 1 above.
[0083] Figure 5 It is a schematic structural diagram of a device provided by an embodiment of the present invention.
[0084] Such as Figure 5As shown, as another aspect, the present application also provides a device 500, including one or more central processing units (CPU) 501, which can be 508 programs loaded into random access memory (RAM) 503 to execute various appropriate actions and processes. In the RAM 503, various programs and data necessary for the operation of the device 500 are also stored. The CPU 501 , ROM 502 , and RAM 503 are connected to each other via a bus 504 . An input / output (I...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


