Generating a Universal Unique Identifier
A Universally Unique Identifier (UUID) is a formatted string used to identify something with reasonable confidence that the identifier will never be unintentionally repeated by anyone for anything else. This is useful for example in creating table-entries with unique IDs, which you might need to merge with another table and not have conflicting ID’s or need to generate new ID’s.
B_UUID is the second installment in my B-Suite of custom types, and is a pure-Lasso method of generating a version 4 (random) Universally Unique Identifier (UUID). The usage is very simple, you simply call the prototype, and the call is replaced by a new UUID.
B_UUID
=> 12c9ca38-ef23-42f2-951b-f6dad1ced320
For the most up-to-date version of this code, I recommend checking the source out from my Google Code account linked to above. As an alternate, you can also view/copy the source from TagSwap.net.
Other methods of creating a UUID in Lasso
- On most operating systems, using Jason Huck’s Shell tag, or the built in OS_Process tag, the `uuidgen` command can be used to return a version 4 UUID.
- Steffan Cline has recently posted a cross-platform LJAPI module, GetUUID, that is most likely faster than any solution written in Lasso Script, or certainly any solution that needs to open a shell.
- My understanding is that when LassoSoft releases Lasso 9 (most likely October, 2009) that the built in Lasso_UniqueID will generate a version 4 UUID, similar to B_UUID.
