当前位置:网站首页>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.
边栏推荐
- QT writing the Internet of things management platform 38- multiple database support
- Every time I look at the interface documents of my colleagues, I get confused and have a lot of problems...
- Lingyun going to sea | Wenhua online & Huawei cloud: creating a new solution for smart teaching in Africa
- On communication bus arbitration mechanism and network flow control from the perspective of real-time application
- Basic use of kotlin
- 实战模拟│JWT 登录认证
- Offset function and windowing function
- Win11共享文件打不开怎么办?Win11共享文件打不开的解决方法
- Talking about cookies of client storage technology
- Optimize if code with policy mode [policy mode]
猜你喜欢
Cann operator: using iterators to efficiently realize tensor data cutting and blocking processing
YOLOv5s-ShuffleNetV2
On communication bus arbitration mechanism and network flow control from the perspective of real-time application
Practice examples to understand JS strong cache negotiation cache
【历史上的今天】7 月 4 日:第一本电子书问世;磁条卡的发明者出生;掌上电脑先驱诞生
实战模拟│JWT 登录认证
Dark horse programmer - software testing - 09 stage 2-linux and database -31-43 instructions issued by modifying the file permission letter, - find the link to modify the file, find the file command,
The company needs to be monitored. How do ZABBIX and Prometheus choose? That's the right choice!
c# .net mvc 使用百度Ueditor富文本框上传文件(图片,视频等)
Win11系统wifi总掉线怎么办?Win11系统wifi总掉线的解决方法
随机推荐
AP8022开关电源小家电ACDC芯片离线式开关电源IC
Win11怎么搜索无线显示器?Win11查找无线显示器设备的方法
Optimize if code with policy mode [policy mode]
Swagger suddenly went crazy
Win11共享文件打不开怎么办?Win11共享文件打不开的解决方法
Crystal optoelectronics: ar-hud products of Chang'an dark blue sl03 are supplied by the company
精选综述 | 用于白内障分级/分类的机器学习技术
Prometheus installation
[graduation season] green ant new fermented grains wine, red mud small stove. If it snows late, can you drink a cup?
电脑页面不能全屏怎么办?Win11页面不能全屏的解决方法
应用实践 | 蜀海供应链基于 Apache Doris 的数据中台建设
Pytoch learning (4)
Why is the maximum speed the speed of light
2022 Health Exhibition, Beijing Health Expo, China Health Exhibition, great health exhibition November 13
2022 version of stronger jsonpath compatibility and performance test (snack3, fastjson2, jayway.jsonpath)
Optimization cases of complex factor calculation: deep imbalance, buying and selling pressure index, volatility calculation
Detailed explanation of Audi EDI invoice message
c# .net mvc 使用百度Ueditor富文本框上传文件(图片,视频等)
Win11无法将值写入注册表项如何解决?
[in-depth learning] review pytoch's 19 loss functions