从String.GetHashCode解密哈希字符串吗? [英] Decrypt hash string from String.GetHashCode?

查看:52
本文介绍了从String.GetHashCode解密哈希字符串吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自MSDN的此示例代码 http://msdn.microsoft.com/en-us/library/system.string.gethashcode.aspx

From this sample code from MSDN http://msdn.microsoft.com/en-us/library/system.string.gethashcode.aspx

"abc"的哈希码为:536991770

The hash code for "abc" is: 536991770

但是如何将"536991770"转换回"abc"?

But how to convert back the "536991770" to "abc"?

推荐答案

这是无法从哈希码中获取价值的方法.请参阅哈希函数定义.哈希值不用于唯一标识原始值,对于每种类型的输入值来说,不是值都是唯一的.

The is no way to get value from the hashcode. See hash-function definition. Hash values are not used to uniquely identify the original value, have values are not unique for each type of the input value.

散列函数可能会映射两个或多个相同哈希值的键.在许多应用程序,这是可取的尽量减少这种情况的发生冲突,这意味着哈希函数必须将键映射到哈希值尽可能均匀.

A hash function may map two or more keys to the same hash value. In many applications, it is desirable to minimize the occurrence of such collisions, which means that the hash function must map the keys to the hash values as evenly as possible.

这篇关于从String.GetHashCode解密哈希字符串吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆