CN101901296A - Method for shuffling through system random number - Google Patents

Method for shuffling through system random number Download PDF

Info

Publication number
CN101901296A
CN101901296A CN2009100855742A CN200910085574A CN101901296A CN 101901296 A CN101901296 A CN 101901296A CN 2009100855742 A CN2009100855742 A CN 2009100855742A CN 200910085574 A CN200910085574 A CN 200910085574A CN 101901296 A CN101901296 A CN 101901296A
Authority
CN
China
Prior art keywords
random number
board
array
value
playing card
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2009100855742A
Other languages
Chinese (zh)
Inventor
刘立军
王磊
张守文
陶勇胜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
HUIXIONG (BEIJING) TECHNOLOGY Co Ltd
Original Assignee
HUIXIONG (BEIJING) TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by HUIXIONG (BEIJING) TECHNOLOGY Co Ltd filed Critical HUIXIONG (BEIJING) TECHNOLOGY Co Ltd
Priority to CN2009100855742A priority Critical patent/CN101901296A/en
Publication of CN101901296A publication Critical patent/CN101901296A/en
Pending legal-status Critical Current

Links

Landscapes

  • Indexing, Searching, Synchronizing, And The Amount Of Synchronization Travel Of Record Carriers (AREA)

Abstract

The invention discloses a method for shuffling through a system random number. The method comprises the following steps of: determining a playing card object, wherein the playing card object comprises two attributes, namely suit and value of the playing card; sequentially generating 54 playing card objects by using a circulating technique; generating 54 random numbers by using an encrypted random number generator and storing the random numbers in an array; establishing a new set object, wherein the object has the characteristics of generic key-value pair and key sort output; sequentially adding elements in the random number array serving as keys of the set and the 54 sorted card objects serving as the values of the set into the set; and finally, sequentially taking the card objects which take the random numbers as the keys and the playing cards as the values and are stored in the set out by using the key sort attribute of the set and storing the card objects in the array of the card objects to finish the shuffling. A set of sorted cards are shuffled and the attributes of the safe random numbers and the set objects are efficiently utilized by the method.

Description

A kind of method of shuffling by system random number
Technical field
The present invention relates to a kind ofly upset the sort method of deck by system random number, particularly a kind of by encrypting the method that unduplicated random number is shuffled the good board of a secondary ordering that produces.
Background technology
At present the method that produces system random number by computerese mainly contains following two kinds:
1, generates random number by " Pseudo-random number generator ".
This method realizes simple, mainly is to obtain pseudo random number by setting random number seed.But the random number precision that obtains is not high, inadequately at random, is easy to generate the random number of a large amount of repetitions.Resulting like this random number can only satisfy: desired random number is not a lot, and allows the situation of repetition.This being applied in to being widely adopted in the less demanding project of random number.And in a large amount of random number of needs, and in the big project of concurrency, can not encrypt because of random number, inadequately at random, repeat number is many and abandoned using.
2, generate random number by " encrypted random number maker ".
This method uses CSP (CSP) to realize encrypted random number maker (RNG).By the random number precision height that cryptographic means produces, safety, repeat number is few, and at random enough.But its shortcoming is the random number that can only produce between 0 to 256.
Summary of the invention
Technical matters to be solved by this invention provides a kind of method that unduplicated random number is shuffled the good board of a secondary ordering that produces of encrypting.One sheet playing card object has two attributes, that is: the value of the pattern of board and board usually.One secondary complete playing card have 54, when generating these 54 board objects, the method that is adopted is that the circulating technology that utilizes machine word to call the turn comes newly-built 54 the board objects of order, and it is stored in the object array, the order of upsetting the board in the array is then provided and is given the user.
A kind of method of shuffling of the present invention by system random number, this method comprises following step at least:
Step 1: determine a sheet playing card object, this object comprises the pattern of board and these two attributes of value of board.
Step 2: utilize circulating technology to produce 54 sheet playing card objects in proper order.
Step 3: utilize the encrypted random number maker to generate 54 random numbers, store in the array then.
Step 4: a newly-built collection object, this object have the feature of general type key-value pair (key/value) and the output of button (key) ordering (sort) order.
Step 5: with the key (key) of the element in the random number array as set, with the board object of 54 orders value (value) as set, order is added (add) in set.
Step 6: during the button ordering attribute of utilization set will gather storage with random number as key (key), with the board object-order taking-up of playing card, store in the array of board object as value (value), shuffle and finish.
A kind of method of shuffling by system random number that the present invention relates to makes the board that a pair is sorted in order carry out the operation of shuffling, and has utilized the safe random number and the attribute of collection object efficiently.
Embodiment
Key step of the present invention is as follows:
Step 1: newly-built two enumeration types, be respectively the pattern of board, comprise the value of black, red, colored, four attributes of sheet and board, comprise 2-10 and J, Q, K, A, SmallKing, these 15 values of BigKing.
Step 2: a newly-built sheet playing card class, this class object comprise the pattern of board and these two attributes of value of board; Utilize the object of two layers of newly-built 54 board of circulation, wherein each board object all has two attributes, and one is the pattern enumerated value of board, and one is board value enumeration value.
Step 3: utilize the encrypted random number maker to generate 54 random numbers, store in the array then; To judge whether during generation and the historical random number repetition that generates, have repetition then to regenerate.
Step 4: the collection object of a newly-built general type, this object have the method for clooating sequence output.
Step 5: utilize circulative metabolism with the key of random number, 54 board objects are added in the set as the value of general type set as general type collection object.
Step 6: call the button sort method of set, order is exported 54 boards.Shuffle and finish.
The board that above-mentioned technical scheme sorts a pair when implementing has in order carried out the operation of shuffling, and has utilized the safe random number and the attribute of collection object efficiently.
It should be noted last that above embodiment is only in order to explanation and unrestricted technical scheme described in the invention; Therefore, although this instructions has been described in detail the present invention with reference to the above embodiments,, those of ordinary skill in the art should be appreciated that still and can make amendment or replacement to the present invention with being equal to; And all do not break away from the technical scheme and the improvement thereof of the spirit and scope of the present invention, and it all should be encompassed in the middle of the claim scope of the present invention.

Claims (1)

1. method of shuffling by system random number, it is characterized in that: this method comprises following step at least:
Step 1: determine a sheet playing card object, this object comprises the pattern of board and these two attributes of value of board.
Step 2: utilize circulating technology to produce 54 sheet playing card objects in proper order.
Step 3: utilize the encrypted random number maker to generate 54 random numbers, store in the array then.
Step 4: a newly-built collection object, this object have the feature of general type key-value pair and the output of button clooating sequence.
Step 5: with the key of the element in the random number array as set, with the board object of 54 orders value as set, order is added in the set.
Step 6: during the button ordering attribute of utilization set will gather storage with random number as key, with the board object-order taking-up of playing card, store in the array of board object as value, shuffle and finish.
CN2009100855742A 2009-05-25 2009-05-25 Method for shuffling through system random number Pending CN101901296A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009100855742A CN101901296A (en) 2009-05-25 2009-05-25 Method for shuffling through system random number

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009100855742A CN101901296A (en) 2009-05-25 2009-05-25 Method for shuffling through system random number

Publications (1)

Publication Number Publication Date
CN101901296A true CN101901296A (en) 2010-12-01

Family

ID=43226829

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009100855742A Pending CN101901296A (en) 2009-05-25 2009-05-25 Method for shuffling through system random number

Country Status (1)

Country Link
CN (1) CN101901296A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108434727A (en) * 2018-03-27 2018-08-24 北京知道创宇信息技术有限公司 electronic card processing method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108434727A (en) * 2018-03-27 2018-08-24 北京知道创宇信息技术有限公司 electronic card processing method and system

Similar Documents

Publication Publication Date Title
CN110910559B (en) Lottery drawing method based on block chain
CN106910156B (en) A kind of New chaotic image encryption method with plaintext association key stream generting machanism
CN100369074C (en) Method for realizing encryption/decryption processing in SMS4 cipher algorithm
CN108964872B (en) Encryption method and device based on AES
CN104734845B (en) Bypass attack means of defence based on full Encryption Algorithm pseudo-operation
US9369486B2 (en) Device and method for encoding input data based on hamming distance and/or weight
Hakmi et al. Programmable deterministic built-in self-test
Eckert et al. DRNG: DRAM-based random number generation using its startup value behavior
Katzgraber Random numbers in scientific computing: An introduction
US20220410017A1 (en) Provably fair games using a blockchain
CN114117557A (en) Hybrid PUF circuit and method based on ring oscillator
CN103034471A (en) Random number generation method and random number generation system
CN101901296A (en) Method for shuffling through system random number
CN106202142A (en) Object matching method in a kind of MMORPG game and server
CN103636159B (en) Method for generating a random output bit sequence
Abdallah et al. Z′-induced invisible right-handed sneutrino decays at the LHC
CN107783028A (en) A kind of chip enters the control method and system of test pattern
CN103338107A (en) A secret key generation method and a secret key generation apparatus
CN104092683B (en) PIN code protecting method and system
CN116089989B (en) Data iterative encryption processing method for offline data terminal
CN110784315B (en) Block chain-based number shaking method and device, computer equipment and storage medium
CN111082918A (en) Two-dimensional random scrambling AES power attack resisting system and method
CN105117199B (en) True random number post-processing system and method
KR102248890B1 (en) System and method for lottery based on public blockchain and verification thereof
Lambert et al. Generalizing Sudoku to three dimensions

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
ASS Succession or assignment of patent right

Owner name: CHINA GAMES COMPETITIVE CULTURE CO., LTD.

Free format text: FORMER OWNER: GRIZZLY (BEIJING) TECHNOLOGY CO., LTD.

Effective date: 20111111

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 102218 CHANGPING, BEIJING TO: 570215 HAIKOU, HAINAN PROVINCE

TA01 Transfer of patent application right

Effective date of registration: 20111111

Address after: 570215 room 17A, crystal building, Pearl River Plaza, No. 2, Kun Kun Road, Hainan, Haikou

Applicant after: Middle reaches competitive culture Limited by Share Ltd

Address before: 102218, 701, building 39, 2 District, Tiantongyuan north, Beijing, Changping District, 7

Applicant before: Huixiong (Beijing) Technology Co., Ltd.

C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20101201