当前位置:网站首页>Function analysis and source code of hash guessing game system development
Function analysis and source code of hash guessing game system development
2022-07-04 20:36:00 【VC_ MrsFu123】
Hash (Hash) Algorithm , Hash function . It's a one-way cryptosystem , That is, it is an irreversible mapping from plaintext to ciphertext , Only the encryption process , No decryption process . meanwhile , Hash function can change the input of any length to get fixed length output . This one-way feature of the hash function and the fixed length of the output data make it possible to generate messages or data .
The hash algorithm ( Hash algorithm or message digest algorithm ) It is a basic technology used in information storage and query , It is based on Hash File construction method of function , Map a given key value of any length to a hash value of fixed length , Generally used for authentication 、 authentication 、 encryption 、 Index, etc. . Its main advantage is that the operation is simple , Short pretreatment time , Low memory consumption , Matching search speed is relatively fast , Easy to maintain and refresh , Support more matching rules .
Hash Methods of constructors
1. direct addressing :
Direct addressing is based on data element keywords k Itself or its linear function as its hash address , namely :H(k)=k or H(k)=a×k+b;( among a,b Constant )
2. Digital analysis :
Suppose that every keyword in the keyword set is created by s Digit composition (u1,u2,…,us), Analyze the whole set of keywords , And a number of evenly distributed bits or their combination are extracted as addresses .
Numerical analysis is a method of taking some digits with uniform values in the keywords of data elements as hash addresses . That is, when there are many digits of keywords , You can analyze the keywords , Lose the unevenly distributed bits , As Hashi is worth . It is only suitable for all cases where the keyword value is known . By analyzing the distribution, the keyword value range is transformed into a smaller keyword value range .
3. Folding method :
Split keywords into parts , Then take the sum of them as the hash address . Two methods of superposition processing : Shift stacking : Align and add the low order of the divided parts ; Boundary overlay : Fold back and forth along the division boundary from one end , And then align and add .
The so-called folding method is to divide keywords into parts with the same number of digits ( The number of digits in the last part can be different ), And then you take the sum of these parts ( Give up the carry ), This method is called folding method . This method is applicable to keywords with many digits , And the number distribution on each digit in the keyword is roughly uniform .
In the folding method, digital folding is divided into two methods: shift superposition and boundary superposition , Shift superposition is to align the lowest bit of each part after segmentation , Then I add ; Boundary superposition is folding back and forth along the division boundary from one end to the other , And then align and add .
Hash property :
(1) One way .That is,given an input number,it is easy to calculate its hash value,but given a hash value,the original input number cannot be obtained according to the same algorithm.
(2) Weak anti-collision .That is,given an input number,it is computationally infeasible to find another hash value to get a given number when using the same method.
(3) Strong collision resistance .That is,for any two different input numbers,it is not feasible to calculate the same hash value according to the same algorithm.
边栏推荐
- Practice examples to understand JS strong cache negotiation cache
- Dark horse programmer - software testing - stage 07 2-linux and database -09-24-linux command learning steps, wildcards, absolute paths, relative paths, common commands for files and directories, file
- The problem of the maximum difference between the left and right maxima
- In operation (i.e. included in) usage of SSRs filter
- 九齐单片机NY8B062D单按键控制4种LED状态
- Write it down once Net analysis of thread burst height of an industrial control data acquisition platform
- NetCore3.1 Json web token 中间件
- 华为nova 10系列支持应用安全检测功能 筑牢手机安全防火墙
- Integretee integrates into Moonriver through xcm, bringing enterprise class privacy solutions to its ecosystem
- Ziguang zhanrui completed the first 5g R17 IOT NTN satellite on the Internet of things in the world
猜你喜欢
Win11U盘拒绝访问怎么办?Win11U盘拒绝访问的有效解决方法
[in-depth learning] review pytoch's 19 loss functions
Aiming at the "amnesia" of deep learning, scientists proposed that based on similarity weighted interleaved learning, they can board PNAS
电脑页面不能全屏怎么办?Win11页面不能全屏的解决方法
Flet教程之 06 TextButton基础入门(教程含源码)
[today in history] July 4: the first e-book came out; The inventor of magnetic stripe card was born; Palm computer pioneer was born
紫光展锐完成全球首个 5G R17 IoT NTN 卫星物联网上星实测
c# .net mvc 使用百度Ueditor富文本框上传文件(图片,视频等)
HMM hidden Markov model and code implementation
Employment prospects of neural network Internet of things application technology [welcome to add]
随机推荐
Introduction to ACM combination counting
In operation (i.e. included in) usage of SSRs filter
Hash哈希竞猜游戏系统开发如何开发丨哈希竞猜游戏系统开发(多套案例)
泰山OFFICE技术讲座:关于背景(底纹和高亮)的顺序问题
Multi table operation inner join query
repeat_ P1002 [NOIP2002 popularization group] cross the river pawn_ dp
Win11亮度被锁定怎么办?Win11亮度被锁定的解决方法
Ziguang zhanrui completed the first 5g R17 IOT NTN satellite on the Internet of things in the world
凌云出海记 | 一零跃动&华为云:共助非洲普惠金融服务
【ISMB2022教程】图表示学习的精准医疗,哈佛大学Marinka Zitnik主讲,附87页ppt
公司要上监控,Zabbix 和 Prometheus 怎么选?这么选准没错!
Win11怎么搜索无线显示器?Win11查找无线显示器设备的方法
Optimization cases of complex factor calculation: deep imbalance, buying and selling pressure index, volatility calculation
CDGA|数据治理不得不坚持的六个原则
Template_ Large integer subtraction_ Regardless of size
2022 Health Exhibition, health exhibition, Beijing Great Health Exhibition and health industry exhibition were held in November
凌云出海记 | 文华在线&华为云:打造非洲智慧教学新方案
更强的 JsonPath 兼容性及性能测试之2022版(Snack3,Fastjson2,jayway.jsonpath)
Length of the longest integrable subarray
Write it down once Net analysis of thread burst height of an industrial control data acquisition platform