有没有方法在Mac上生成标准的128位GUID(UUID)? [英] Is there a method to generate a standard 128bit GUID (UUID) on the Mac?

查看:704
本文介绍了有没有方法在Mac上生成标准的128位GUID(UUID)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一个等同于.NET的内置函数

Is there a built in function equivalent to .NET's

Guid.NewGuid();

在Cocoa?

以产生代表唯一标识符的550e8400-e29b-41d4-a716-446655440000行的字符串。

My desire is to produce a string along the lines of 550e8400-e29b-41d4-a716-446655440000 which represents a unique identifier.

推荐答案

UUID在Core Foundation中由CFUUID库处理。您要查找的函数是 CFUUIDCreate

UUIDs are handled in Core Foundation, by the CFUUID library. The function you are looking for is CFUUIDCreate.

FYI用于进一步搜索:这些通常称为UUID,术语GUID在Microsoft世界。您可能更喜欢该搜索字词。

FYI for further searches: these are most commonly known as UUIDs, the term GUID isn't used very often outside of the Microsoft world. You might have more luck with that search term.

这篇关于有没有方法在Mac上生成标准的128位GUID(UUID)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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