SAS中文论坛

 找回密码
 立即注册

扫一扫,访问微社区

查看: 948|回复: 3
打印 上一主题 下一主题

请教一个hash的入门问题

[复制链接]

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
楼主
 楼主| 发表于 2008-3-7 16:03:54 | 只看该作者

请教一个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 ,也没弄明白。

请教了 呵呵!!
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
沙发
 楼主| 发表于 2008-3-7 16:47:34 | 只看该作者

Re: 请教一个hash的入门问题

hash 对象在很多地方都有,比如perl里边就有,像vb.net的Hashtable, collection, dictionary.
基本道理就是一对对的数值一一对应. 然后通过查询Key ,就会很快定位key所对应的item.
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
板凳
 楼主| 发表于 2008-3-12 09:11:23 | 只看该作者

Re: 请教一个hash的入门问题

期待大家的跟铁,把这个问题搞深入啊
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
地板
 楼主| 发表于 2008-3-14 12:17:09 | 只看该作者

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.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SAS中文论坛  

GMT+8, 2026-2-4 16:16 , Processed in 0.070474 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表