标题: 请教一个hash的入门问题 [打印本页] 作者: shiyiming 时间: 2008-3-7 16:03 标题: 请教一个hash的入门问题 最近在看sas help 里面关于hash对内容,初学。
The hash object provides an efficient, convenient mechanism for quick data storage and retrieval. The hash object stores and retrieves data based on lookup keys.
请问这里的lookup keys 是什么意思? 以前好像也看到过lookup table ,也没弄明白。
请教了 呵呵!!作者: shiyiming 时间: 2008-3-7 16:47 标题: Re: 请教一个hash的入门问题 hash 对象在很多地方都有,比如perl里边就有,像vb.net的Hashtable, collection, dictionary.
基本道理就是一对对的数值一一对应. 然后通过查询Key ,就会很快定位key所对应的item.作者: shiyiming 时间: 2008-3-12 09:11 标题: Re: 请教一个hash的入门问题 期待大家的跟铁,把这个问题搞深入啊作者: shiyiming 时间: 2008-3-14 12:17 标题: Re: 请教一个hash的入门问题 The following is captured from 维基百科:
Hash function is used to generate "finger print" most of the time. Hash function can be any algorithm, but must guarantee different input, must generate different output (uniqueness). MD5 is a good example.
Example of hash can be used as password storage. The hash function itself is not reversible (You cannot provide an output to get the input), and thus the system does not know the original input. Following is an example:
Password = "123456";
Hash(Password) will generate something like "D2AC55";
Where "D2AC55" will be stored at the system. In future, when someone is asked to provide the password again, the system will do:
if (Hash(input_password) == "D2AC55")
then OK;
else WRONG_PASSWORD;
The system cannot generate "12345" by providing "D2AC55", and thus is quite safe.