I need to generate some int value that would never repeat (at least theoretically). I know there is arc4random() fnc but I'm not sure how to use it with some current date or smth :(
1. type 1 into the cell which is adjacent to the first data you want to add ID number. 2. Then in the cell below it, type this formula =IF(B1=B2,A1,A1+1), press Enter key to get the first result, drag fill handle down until last data showing up.
Some agencies give people a 'unique identifier' instead of using their name. Examples are a driver's licence number, a passport number, a student ID number, or an IRD number.
A GUID (globally unique identifier) is a 128-bit text string that represents an identification (ID). Organizations generate GUIDs when a unique reference number is needed to identify information on a computer or network. A GUID can be used to ID hardware, software, accounts, documents and other items.
Google Forms automatically assigns a unique, non-sequential and non-guessable identifier (id) to every form entry. This Unique Id contains a mix of alphabets and digits. You can use this unique ID in subject line and message body of your email template with the help of dynamic form fields.
This returns a unique key very similar to UUID generated in MySQL.
+ (NSString *)uuid { CFUUIDRef uuidRef = CFUUIDCreate(NULL); CFStringRef uuidStringRef = CFUUIDCreateString(NULL, uuidRef); CFRelease(uuidRef); return [(NSString *)uuidStringRef autorelease]; }
ARC version:
+ (NSString *)uuid { CFUUIDRef uuidRef = CFUUIDCreate(NULL); CFStringRef uuidStringRef = CFUUIDCreateString(NULL, uuidRef); CFRelease(uuidRef); return (__bridge_transfer NSString *)uuidStringRef; }
A simple version to generate UUID (iOS 6 or later).
Objective-C:
NSString *UUID = [[NSUUID UUID] UUIDString];
Swift 3+:
let uuid = UUID().uuidString
It will generate something like 68753A44-4D6F-1226-9C60-0050E4C00067, which is unique every time you call this function, even across multiple devices and locations.
Reference: https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSUUID_Class/Reference/Reference.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With