iOS中使用CFUUID生成的ID有多独特? [英] How unique are the ids generated with CFUUID , in iOS?

查看:273
本文介绍了iOS中使用CFUUID生成的ID有多独特?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标题实际上是我的问题。既然Apple不再允许使用UUID,我决定使用CFUUID。

The title is my question actually. Now that Apple doesnt allow any more the use of UUID i decided to go with the CFUUID.

但是我对此有一些疑问。

However i have some questions regarding it.

每个设备都是唯一的吗?如果是,它与UUID有什么不同?

Is is unique for every device? If yes how is it different from UUID?

它是一个随机生成器吗?如果是的话有多好?我可以肯定在10000个设备中不会有重复吗?

Is it a random generator? If yes how good is it? Can i be sure that in 10000 devices there wont be a duplicate?

我在这个使用CFUUID的解决方案之间,并让我的服务器生成一个随机的唯一标识符,我可以肯定的。但是,这需要在服务器和设备之间进行不必要的编码和http请求。

I am between in this solution of using CFUUID , and having my server generating a random unique identifier that i can be sure of. However this would need unnecessary coding and http requests between the server and the devices.

任何想法?

推荐答案

当你说苹果不允许使用UUID时,你必须指的是UDID或唯一设备ID。

When you say that apple doesn't allow the use of UUID, you must be referring to the UDID, or Unique Device ID.

每次生成UUID时,UUID都是唯一的。它不仅仅是一个UDID。 UUID在全球范围内是独一无二的。

A UUID is unique every time you generate one. It's not simply a UDID. UUIDs are unique globally.


它是否对每个设备都是唯一的?如果是,它与UDID有什么不同?

Is it unique for every device? If yes how is it different from UDID?

是的,它对每个设备都是唯一的,因为UUID的一部分是一个隐藏ID,不过它不是整个UDID。 UDID始终相同。每次创建UUID时,它都与上一个不同,因此如果您想将UUID用作设备ID,则需要存储UUID。

Yes, it's unique for every device because part of a UUID is a devide ID, though it's not the entire UDID. The UDID is always the same. Each time you create a UUID, it's different from the last, so you would need to store the UUID if you wanted to use it as a device ID.


它是随机发电机吗?如果是的话有多好?我可以肯定在
10000设备中不会有重复吗?

Is it a random generator? If yes how good is it? Can i be sure that in 10000 devices there wont be a duplicate?

计算UUID,而不是随机生成。第一部分是设备ID的形式,第二部分是从日期和时间派生的。虽然UUID的日期和时间部分可能在设备之间重复,但设备ID部分仍然保证全局唯一的UUID。

A UUID is computed, not randomly generated. The first part is a form of device ID, and the second part is derived from the date and time. While the date and time part of a UUID may be duplicated between devices, the device ID portion still guarantees unique UUIDs globally.

这篇关于iOS中使用CFUUID生成的ID有多独特?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆