生成唯一编号 [英] Generating unique number
本文介绍了生成唯一编号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我 INT32
数据类型的三个变量在C ++中。我想生成 C ++
三 INT32
数字组合的唯一编号。比如我有 INT iVal1
, INT iVal2
和 INT iVal3
。是否有任何的算法来做到这一点?
I have three variables of int32
data type in C++. I want to generate unique number for combination of three int32
numbers in C++
. For example I have int iVal1
, int iVal2
, and int iVal3
. Is there any algorithm to do this?
为了避免混乱的问题我会重组的问题。基本上我想生成三个整数一个唯一的编号,因为我要保存这个数字在地图一键检索数据。
In order to avoid confusion in question I will rephrase the question. Basically I want to generate a unique number with three integers because I want to store this number as a key in map to retrieve the data.
有什么建议?谢谢你。
推荐答案
您可以使用一个好的哈希函数。
You can use a good hash function.
这篇关于生成唯一编号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文