English 中文(简体)
是否有一套综合的监评系统编号和MAC地址的综合投入功能? (C 执行)
原标题:Is there a perfect hash function for the combined input sets of IMEI numbers and MAC addresses? (C implementation)

I m 寻找一种散射功能,我可以用来向连接我们网络的装置提供统一的独一无二的识别器,这些装置要么使用全球移动式电解器,要么是使用异构体连接。

因此,对于任何特定装置,我要么拥有一个,要么拥有一个硬-coded,我可以用来生成 has。

我先是研究过去几小时的散射功能,读一下我可能希望使用的不同的非加密和加密。 我的重点是对业绩的低col,因为经常无法计算 has。

我的前线是MD5、FNV-1a、MurmurHash2、Hsieh和DJB。

无论用什么洗衣,都必须在C实施,并且将使用小型加工器的微型控制器。

我知道,为你们的需要选择良好的洗衣功能的陷阱,是知道你会再提供何种投入。

The reason I m asking this question is that the idea popped into my head that both IMEI and MAC have finite lengths and ranges, so perhaps there exists a fairly simple hash function that can cover the full sets of both and not have collisions. (Thus, a perfect hash function)

长期监测指数为15位精度数(12-13位高分数)和6位中位数。 我不认为你在两组投入数字之间会发生碰撞,但认为如果错的话,我可以自由纠正。 如果你能做些什么来防止这种情况? 将一些种子添加到其中之一?

Am I on the right track? Is finding perfect hash function for these combined sets possible?

Thanks!

Update

Thanks for the answers and comments. I ended up using the identity function ;) as my hash function, and then also using a mask since there is potential overlap across the sets of numbers.

IMEI, IMEISV, and MAC will all fit in 6.5 bytes or less, so I am storing my values in 7 bytes and then doing a bitwise OR on the first byte with a mask based on which set the number comes from, to ensure they are unique across all sets.

最佳回答

在一套不为人知的、不断增长的投入方面,不可能做到完美无缺。 你可以简单地把这个领域提升到比“监评”或“监测、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、评估、 任何较小的<斯特龙>将碰撞,但可能非常少见。

问题回答

暂无回答




相关问题
Fastest method for running a binary search on a file in C?

For example, let s say I want to find a particular word or number in a file. The contents are in sorted order (obviously). Since I want to run a binary search on the file, it seems like a real waste ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Trying to split by two delimiters and it doesn t work - C

I wrote below code to readin line by line from stdin ex. city=Boston;city=New York;city=Chicago and then split each line by ; delimiter and print each record. Then in yet another loop I try to ...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

Encoding, decoding an integer to a char array

Please note that this is not homework and i did search before starting this new thread. I got Store an int in a char array? I was looking for an answer but didn t get any satisfactory answer in the ...

热门标签