Skip to content

karbonworks/DWUUID

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

DWUUID

A simple Objective-C wrapper for CFUUID.
© 2012 Dan Wineman. Published under the MIT License.

Usage

A DWUUID is immutable and has the same uniqueness guarantees as CFUUID (Universally Unique Identifier, a 128-bit value generated using the computer's Ethernet hardware address and a timestamp). It conforms to NSCoding and NSCopying, and it implements -hash and -isEqual:, so it can be used as an NSDictionary key.

DWUUID.m may be compiled with or without ARC.

Examples

#import "DWUUID.h"

DWUUID *uuid = [[DWUUID alloc] init];
    
// Get the UUID as a string
NSString *uuidString = [uuid stringValue];

// Get the UUID as a 16-byte CFUUIDBytes struct
CFUUIDBytes uuidBytes = [uuid bytes];
    
// Easy logging
NSLog(@"My UUID is: %@", uuid);
    
// Clean up (if not using ARC)
[uuid release];

About

An Objective-C wrapper for CFUUID

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published