topics

全部话题 - 话题: hash
首页 3 4 5 6 7 末页 (共10页)
y********o
发帖数: 2565
1
来自主题: Database版 - SQL Server 2005: How to hash a column?
Yes, thx. I read something about that, too. It is more complicated than ha
shing and it seems that passwords are better hashed than encrypted.
y********o
发帖数: 2565
2
来自主题: Database版 - SQL Server 2005: How to hash a column?
Oh, is that right? I thought that 1-way hash isn't reversible. Good to know.
y********o
发帖数: 2565
3
来自主题: Database版 - SQL Server 2005: How to hash a column?
Yes, I understand public-key encryption. I was asking if the type of encryp
tion you were talking about in SQL Server is asymmetric.

encryption.
connected to private key, i.e. you encrypt the data using the public key,
then to decrypt it, you must use the corresponding private key. As you have
said, HASH is one-way, no d
t*****g
发帖数: 1275
4
来自主题: Database版 - 请问怎么用sql实现hash
这样的话,可以试试groupby A,然后把能算的aggregation result都算一算,比如
count,avg,max,min,stddev之类的,也算是pseduo hash了八。倒是要自己review
最后结果的。
k*******s
发帖数: 134
5
来自主题: Database版 - 请问怎么用sql实现hash
Can you send a link of the code for hashing?
thanks,
D*******a
发帖数: 3688
6
来自主题: Programming版 - Interview questions about hash function
you can use any hash functions, e. g. sum all characters mod 2^32-1

less
v**e
发帖数: 49
7
来自主题: Programming版 - C下有没有好用的hash table函数库?
如体,
程序是用c写的,需要使用hash表来存储一些数据。谢了先。
r****t
发帖数: 10904
8
来自主题: Programming版 - C下有没有好用的hash table函数库?
google has a gpled hash libarary, I heard.
l*****d
发帖数: 236
9
来自主题: Programming版 - c++ stl里面有hash table吗?
Isn't std::map hash?
r*******y
发帖数: 290
10
来自主题: Programming版 - c++ stl里面有hash table吗?
SGI STL uses R-B tree to implement map
they provide anyother map using hash as hash_map
l*****d
发帖数: 236
11
来自主题: Programming版 - c++ stl里面有hash table吗?
see...Looks like similar as Perl's hash?
l*****c
发帖数: 1153
12
来自主题: Programming版 - hash算法一问
If that works, that's not a good hash.
z***d
发帖数: 350
13
来自主题: Programming版 - hash算法一问
操作的文件是一些媒体文件,几十M到几百M不等,虽然算一个100多M的文件的也就几百
毫秒,但几千个文件加起来就是很长的时间了。这些媒体文件内容都不一样,所以采样
做hash应该是够用了,只是想找一个好点的算法,使每个文件的采样分布都能尽量不同
z***d
发帖数: 350
14
来自主题: Programming版 - hash算法一问
目的是算文件的GUID,MD5当然是最好的,但又想performance好点,就考虑弄个偷懒的
伪hash
b***y
发帖数: 2799
15
来自主题: Programming版 - Universal Hashing 是怎么回事?
看了半天,不太明白,是有一组hash函数,然后每次操作前随机挑一个?那么同一个
KEY,第一次用函数a存的,取的时候用函数b,映射的地址不一样,取不出来啊。
T*******i
发帖数: 4992
16
来自主题: Programming版 - map 和hash map有什么区别?
rb-tree and hash-table
btw,你都找了这么久的工作呀
h**o
发帖数: 548
17
来自主题: Programming版 - a question about hash.
我大致明白这段程序是把一个字符串 hash 成一个值。就是不知道这里的 31 和 7951
是 随便定的那, 还是由什么著名的算法规定的。求教:
static unsigned int bm_Hash(const void *key, unsigned int size1)
{
unsigned long hashval=0, hv;
unsigned char *s=(unsigned char *)key;
for (hashval = 0; (s != NULL) && (*s != '\0'); s++)
hashval = (*s) + 31*hashval;
hv = hashval*7951;
return (size1)?(hv % size1):0;
}
F*******i
发帖数: 190
18
来自主题: Programming版 - perl question: can I have a key of hash to be
请问高手
有没有可能, 让 perl hash 的 key
是一个 array such as [$key_part1, $key_par2],
然后可以自己定义 equal between this new key?
或者, 有什么 module 可以作这个?
谢谢
C**********n
发帖数: 100
19
hash 查找 O(1)
BST 查找 O(log2n)
那他们各在什么场合用呢? 多谢。
b***y
发帖数: 2799
20
来自主题: Programming版 - 问个HASH的问题
HASH函数经常需要把一个[0,m)的数字映射到[0,n),
我发现很多地方是用:new = old / (m / n + 1),
为什么不用 new = old / ((m-1) / n) 呢?
比如说m = 100, n = 50,前者的转换区间是到[0, 33],后者是[0, 49],明显是后者好
啊。
d********o
发帖数: 1738
21
来自主题: Programming版 - reversed hash
why does the reversed hash lost some paired value?
j***3
发帖数: 142
22
来自主题: Programming版 - 问一个perl的有关hash的问题
open FILE, $file
my %NAME = ();
while (my $line = ) {
my @a = split " ", $line;
my $location = $a[2];

$NAME{$a[1]."#".$location} .= $a[0]."#";

}
close FILE;
请问
$NAME{$a[1]."#".$location} .= $a[0]."#";
是什么意思啊?以前没有学过这样用hash的, 也google不到。
谢谢。
w******p
发帖数: 166
23
来自主题: Programming版 - 问一个perl的有关hash的问题
for input file:
100 A Paris
200 A Chicago
100 B Paris
300 A Chicago
100 B Paris
%Name becomes:
A#Paris ==> 100#
A#Chicago ==> 200#300#
B#Paris ==> 100#100#
the question is not how to use hash, but how to use string:
"." concats strings
".=" similar
y***d
发帖数: 2330
24
阅读了一下,依赖于 hash table 的实现方式;动态分配内存的没有这个问题
http://en.wikipedia.org/wiki/Hash_table
a*******s
发帖数: 79
25
linear probing大概是比你要hash的项数大的那个素数吧
b******n
发帖数: 592
26
来自主题: Programming版 - 问个hash table问题
基本上就是把key用hash函数转化为index,然后用这个index再table中locate。
Add: (key, value)
key -> index
is table[index] empty?
yes, add key,value
no, is table[index+1] empty? 假设你不删除,不然用list来解决不同key映射到同
index
...
Find: (key)
key -> index
is table[index].key == key?
yes, return value
no, is table[index+1].key == key?
.....
这是我最常用的设计。
S**I
发帖数: 15689
s******a
发帖数: 184
28
来自主题: Programming版 - Perl:如何处理这种hash 结构,
我有两个Excel 文件,第一个文件存着下面这样的数据
12 A P1
23 B P5
24 C P2
15 D P1
06 E P5
第二个文件存着下面这样的数据
06 100
23 20
06 200
06 95
23 05
24 18
基于第一个文件, 我产生了下面这样的结构
$VAR1 = {
'P5' => {
'E' => '06',
'B' => '23'
},
'P2' => {
'C' => '24'
},
'P1' => {
'A' => '12',
'D' => '15'
}
};
我是这么做得
my %Var1;
for my $i (1 .. $row1)
{
# for simplicity, I just keep the main part to building this hash chain
$Var1{$column3}->{$column2} = {$column1};
}... 阅读全帖
w***g
发帖数: 5958
29
来自主题: Programming版 - Hash virtual memory address
hash 内存块首地址不行吗?那样跟块的大小无关。
w****o
发帖数: 2260
30
【 以下文字转载自 JobHunting 讨论区 】
发信人: winhao (勇敢的人), 信区: JobHunting
标 题: 问几个关于hash, map, set的问题
发信站: BBS 未名空间站 (Wed Mar 7 14:52:17 2012, 美东)
1. STL中的std::unordered_map是不是等同于(或者是类似)Java中的Hashmap?
2. STL中的std::map是不是等同于(或者是类似)Java中的Treemap?
3. STL中hashtable是哪个类实现的?Java中类似的哪个类叫什么名字?问的就是在STL
和Java下都是叫什么名字。
4. 为什么在我的linux机器上的目录/usr/include/c++/4.1.2下只有set, map而没有
multiset和multimap?你们的系统里有multiset和multimap吗?
另外我发现STL的unordered_map和unordered_set是定义在/usr/include/c++/4.1.2/
tr1下面的。
谢谢!
w****o
发帖数: 2260
31
【 以下文字转载自 JobHunting 讨论区 】
发信人: winhao (勇敢的人), 信区: JobHunting
标 题: 问几个关于hash, map, set的问题
发信站: BBS 未名空间站 (Wed Mar 7 14:52:17 2012, 美东)
1. STL中的std::unordered_map是不是等同于(或者是类似)Java中的Hashmap?
2. STL中的std::map是不是等同于(或者是类似)Java中的Treemap?
3. STL中hashtable是哪个类实现的?Java中类似的哪个类叫什么名字?问的就是在STL
和Java下都是叫什么名字。
4. 为什么在我的linux机器上的目录/usr/include/c++/4.1.2下只有set, map而没有
multiset和multimap?你们的系统里有multiset和multimap吗?
另外我发现STL的unordered_map和unordered_set是定义在/usr/include/c++/4.1.2/
tr1下面的。
谢谢!
X****r
发帖数: 3557
32
输入未必是均匀分布的。s和M互质可以最大范围地使用输入每一个字符的信息。
极端一点,M=s,那hash就等于输入的最后一个字符,前面全部没有用上。
或者比如s=256,M=1024,那只有输入的倒数第二个字符的最低两位和
最后一个字符起了作用。
t****t
发帖数: 6806
33
来自主题: Programming版 - 问一个hash code的问题
等概率的话, 加权相加不就好了. 这是数据压缩. 如果是hash就再mod一个数.
m*******l
发帖数: 12782
34
来自主题: Programming版 - 问一个hash code的问题
你见过写hash用偶数的么?
w**z
发帖数: 8232
35
来自主题: Programming版 - 怎么做hash运算?
把你的hash 按时间index.
v*******e
发帖数: 11604
36
来自主题: Programming版 - 问个hash函数问题
开个1G的静态数组,用hash函数来索引。那么是不是用到0.5G后就会性能大大下降啊?
有没有解决办法了?内存大小对我的程序很重要,没办法那样浪费呀。有没有不浪费的
办法?
k****i
发帖数: 128
37
来自主题: Programming版 - consistent hashing实际应用
每个环上的server都要maintain整个环的hash=>server mapping,如果环有变化,交换
message的量不是会很大?
k****i
发帖数: 128
38
来自主题: Programming版 - consistent hashing实际应用
可能我理解的有问题,比如cassandra,request可以发到环上任何server,那这个
server如何知道目标在哪个server上?所以每个server都要maintain整个环上hash
range和server的mapping吧。如果一台server down掉要重新交换信息维护这个mapping吧
w**z
发帖数: 8232
39
来自主题: Programming版 - consistent hashing实际应用
Cassandra 2.X 有了virtual node, 稍微复杂一点。1.X 就很简单了,根据hash值就知
道在哪个node 上了。存这信息的数据量是很小的。 replace node,的话,stream data
的量就很可观了。vnode 的好处之一就是大大加快了bootstrap.所有node 都会参与
stream.

mapping吧
h*****u
发帖数: 109
40
来自主题: Programming版 - 请教good hash function
没有。用的是现有的配置。std::hash好很多啊。
l*******m
发帖数: 1096
41
来自主题: Programming版 - 请教good hash function
你试试狗的highway hash, https://github.com/google/highwayhash 至少是simd,
漏洞小些
g*********e
发帖数: 14401
42
来自主题: Programming版 - 请教good hash function
好的hash节省CPU 应该从减少除法的数量这个角度去考虑。多用为运算和加减乘
a*****1
发帖数: 314
43
如果把所有user 放到一个 hash。这种方法 是不是 通用方法?
序列化 反序列化 开销 没那么大吧?
[在 dynkin (化神奇为腐朽) 的大作中提到:]
:只有内存限制,应该没有数量限制。不过redis是单线程,你要是并发的可能有点问题
c******n
发帖数: 16666
44
来自主题: Programming版 - 怎么找到hash和原文的关系?
我可是00后 哈哈 开玩笑
我还没用过这个 所以还是等你的结果
之前有次差点用到 后来一查居然是sha1直接hash的,就妥妥得啥都有了
f***y
发帖数: 98
45
来自主题: Unix版 - Perl: hash numerical sort
I have a hash like this:
%h = (
org, 51,
com, 7,
gov, 55,
net, 2,
biz, 5
);
How do I print it out with its value numerically sorted? It would look like:
gov 55
org 51
com 7
biz 5
net 2
Any suggestion would be appreciated. Thanks a lot!
l****s
发帖数: 4
46
来自主题: Computation版 - 求教hashing 算法
怎样创建一个hashing table?
是每一个record都要有一个key吗? key是怎么得到的呢?
谢谢!请不要耻笑我,我真的没有学过这个算法:(
n******t
发帖数: 4406
47
来自主题: Computation版 - 求教hashing 算法
得看书.否则说不清楚.
就是把一个或几个对象,映射成一个整数.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
不见得.一一对应就是perfect hash.
f********s
发帖数: 159
48
来自主题: Computation版 - 问个面试时候hash table的C++实现问题
如果面试时候需要应用到hash table,需要代码实现并且应用, 大家是怎么做的?用
container实现(hash_map,hash_set? 貌似这两个还不是标准stl里的东西), 还是自
己写数据结构(写全了得用会儿时间,还要应用)?JAVA就方便多了有现成hashtable.
求指点。
f*******n
发帖数: 12623
49
来自主题: Computation版 - 问个面试时候hash table的C++实现问题
对,C++98的standard library没有hash table。但是所有主要的compiler都支持hash_
map、hash_set的。一般的面试的人会让你用hash_map、hash_set的。
现在最新出版的C++标准是C++11。C++11的standard library里有unordered_map、
unordered_set。跟hash_map、hash_set一样就是不同名字而已。
w****a
发帖数: 155
50
来自主题: EE版 - 关于Hash table 和 bloom filter
Hash table 和 bloom filter 有什莫区别。
是不是bloom filter更space efficient一些。
首页 3 4 5 6 7 末页 (共10页)