如何生成10位数的唯一编号. [英] How to generate 10 digit unique number.
本文介绍了如何生成10位数的唯一编号.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想生成10位数的唯一编号,我尝试使用日期和时间,但是它大约为14位数.因此,请告诉我如何生成10位数的唯一编号.即使我重新启动应用程序,它也应在新生成的数字中保持唯一性.
我可以生成14位数的唯一编号.可以将这14位数字缩小为10位唯一数字吗?
I want to generate 10 digit unique number, i have tried with date and time but it goes arround 14 digit. so please tell me how can i generate 10 digit unique number. Even if i restart the application it should maintain the uniqueness in the new generated number.
I can able to generate the 14 digit unique number. Is possible to scale down this 14 digit number into 10 digit unique number ?
推荐答案
这可能会有所帮助: ^ ]
这篇文章描述了GUID生成算法,以及如何针对特定情况进行更短的修改.有趣的内容.
This might help a little: Link[^]
The post describes the GUID generation algorithm and how it can be modified for specific situations to be shorter. Interesting read.
请看下面的链接.这可能对您有帮助
http://forums.asp.net/t/1170804.aspx [
Look at the below link. This may help you
http://forums.asp.net/t/1170804.aspx[^]
Kiran
使用Unix时间格式:
http://uk.answers.yahoo.com/question/index?qid=20090928054656AAis0fq [ ^ ]
Use unix time format:
http://uk.answers.yahoo.com/question/index?qid=20090928054656AAis0fq[^]
这篇关于如何生成10位数的唯一编号.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文